chore: improve number widget tests (#2223)

This commit is contained in:
Luis Correia
2019-03-25 18:17:26 +00:00
committed by Shawn Erquhart
parent 2d59602660
commit 19824fd1dd
4 changed files with 258 additions and 154 deletions

9
cypress/utils/README.md Normal file
View File

@ -0,0 +1,9 @@
## Utilities for integration tests
Utils in this dir must be explicitly included in each spec file, e.g.:
```
import '../utils/dismiss-local-backup';
```
For routines to be executed on all tests, please use the `cypress/plugins.index.js` file instead: https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Plugin-files

View File

@ -0,0 +1,17 @@
import { getPhrases } from 'Constants/defaultPhrases';
// Prevents unsaved changes in dev local storage from being used
Cypress.on('window:confirm', message => {
const {
editor: {
editor: { confirmLoadBackup },
},
} = getPhrases();
switch (message) {
case confirmLoadBackup:
return false;
default:
return true;
}
});