diff --git a/cypress/e2e/modal.cy.js b/cypress/e2e/modal.cy.js new file mode 100644 index 0000000..2a79a47 --- /dev/null +++ b/cypress/e2e/modal.cy.js @@ -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") + }) +})