chore: improve number widget tests (#2223)
This commit is contained in:
committed by
Shawn Erquhart
parent
2d59602660
commit
19824fd1dd
9
cypress/utils/README.md
Normal file
9
cypress/utils/README.md
Normal 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
|
17
cypress/utils/dismiss-local-backup.js
Normal file
17
cypress/utils/dismiss-local-backup.js
Normal 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;
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user