Skip to content

Commit

Permalink
add tests for closing modal
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Sep 7, 2023
1 parent 0f09ce7 commit 91ea6fd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cypress/e2e/modal.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
describe("modal", () => {
// closing modal works
it("click on close closes the modal", () => {
cy.visit("/w3id.org/index.de.html")
cy.get("#settingsModal").should("not.be.visible")
cy.get("#settings").click()
cy.get("#settingsModal").should("be.visible")
cy.get("#closeModal").click()
cy.get("#settingsModal").should("not.be.visible")
})

it("click outside closes the modal", () => {
cy.visit("/w3id.org/index.de.html")
cy.get("#settingsModal").should("not.be.visible")
cy.get("#settings").click()
cy.get("#settingsModal").should("be.visible")
cy.get("#settingsModal").click(-5, -5)
cy.get("#settingsModal").should("not.be.visible")
})
})

0 comments on commit 91ea6fd

Please sign in to comment.