Skip to content

Commit

Permalink
Update nested dialogs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Aug 11, 2022
1 parent 942ba6b commit b1f97e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/nestedDialogs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1f97e1

Please sign in to comment.