Skip to content

Commit 1096ba9

Browse files
committed
conditional dialog close
1 parent 1d53b1e commit 1096ba9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cypress/e2e/success-or-error.cy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,13 @@ describe('DOM matchers', { defaultCommandTimeout: 4_000 }, () => {
6767
})
6868
})
6969
})
70+
71+
it('closes dialog if open', { viewportWidth: 800, viewportHeight: 600 }, () => {
72+
cy.visit('cypress/close-dialog.html')
73+
cy.depends({
74+
'dialog[open]': ($dialog) => {
75+
cy.wrap($dialog).find('button#close').click()
76+
},
77+
'dialog:hidden': 'dialog is already closed',
78+
})
79+
})

0 commit comments

Comments
 (0)