From b1f97e12df7199f9cde44c3933293250f73a9ece Mon Sep 17 00:00:00 2001 From: Kitty Giraudel Date: Thu, 11 Aug 2022 10:21:24 +0200 Subject: [PATCH] Update nested dialogs tests --- cypress/e2e/nestedDialogs.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/nestedDialogs.cy.js b/cypress/e2e/nestedDialogs.cy.js index 23c5e521..2ff44c07 100644 --- a/cypress/e2e/nestedDialogs.cy.js +++ b/cypress/e2e/nestedDialogs.cy.js @@ -13,15 +13,15 @@ describe('Nested dialogs', () => { }) it('should close only the top most dialog when pressing ESC', () => { - cy.get('body').trigger('keydown', { key: 'Escape', keyCode: 27, which: 27 }) + cy.realPress('Escape') cy.get('[data-a11y-dialog="dialog-2"]').then(shouldBeVisible) cy.get('[data-a11y-dialog="dialog-3"]').then(shouldBeHidden) }) it('should close only the top most dialog when clicking the backdrop', () => { - cy.get('body').trigger('keydown', { key: 'Escape', keyCode: 27, which: 27 }) cy.get('[data-a11y-dialog="dialog-2"]') .find('.dialog-overlay') + .first() .click({ force: true }) cy.get('[data-a11y-dialog="dialog-1"]').then(shouldBeVisible) cy.get('[data-a11y-dialog="dialog-2"]').then(shouldBeHidden)