chore(deps): update dependency cypress to v4.8.0 (#3883)

This commit is contained in:
renovate[bot]
2020-06-11 10:20:48 +03:00
committed by GitHub
parent afc9bf4f3f
commit 374783509b
2 changed files with 21 additions and 13 deletions

View File

@ -278,21 +278,29 @@ function createPostAndExit(entry) {
exitEditor();
}
function advanceClock(clock) {
if (clock) {
// https://github.com/cypress-io/cypress/issues/1273
clock.tick(150);
clock.tick(150);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
}
}
function publishEntry({ createNew = false, duplicate = false } = {}) {
cy.clock().then(clock => {
// some input fields are de-bounced thus require advancing the clock
if (clock) {
// https://github.com/cypress-io/cypress/issues/1273
clock.tick(150);
clock.tick(150);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
}
advanceClock(clock);
if (createNew) {
advanceClock(clock);
selectDropdownItem('Publish', publishTypes.publishAndCreateNew);
advanceClock(clock);
} else if (duplicate) {
advanceClock(clock);
selectDropdownItem('Publish', publishTypes.publishAndDuplicate);
advanceClock(clock);
} else {
selectDropdownItem('Publish', publishTypes.publishNow);
}