From 91ea6fda85b11a60ed12ca9c439a57a07726a100 Mon Sep 17 00:00:00 2001 From: "@s.roertgen" Date: Thu, 7 Sep 2023 08:23:20 +0200 Subject: [PATCH] add tests for closing modal --- cypress/e2e/modal.cy.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cypress/e2e/modal.cy.js 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") + }) +})