From c52e51fe5dcc22bed5671d3931c76c47130d3da5 Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Fri, 6 Oct 2023 16:16:08 +0100 Subject: Add new Cypress tests --- cypress/e2e/event.cy.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/event.cy.ts b/cypress/e2e/event.cy.ts index ef8b249..10266b7 100644 --- a/cypress/e2e/event.cy.ts +++ b/cypress/e2e/event.cy.ts @@ -22,7 +22,7 @@ describe("Events", () => { beforeEach(() => { cy.clearLocalStorage(); - cy.visit("/new/event/public"); + cy.visit("/new"); cy.get("#showNewEventFormButton").click(); cy.get("#eventName").type(eventData.eventName); @@ -95,4 +95,21 @@ describe("Events", () => { cy.get(".dt-duration").should("contain.text", startTime); cy.get(".dt-duration").should("contain.text", endTime); }); + + it("allows you to attend an event", function () { + cy.get("button#attendEvent").click(); + cy.get("#attendeeName").type("Test Attendee"); + cy.get("#attendeeNumber").clear().type("2"); + cy.get("form#attendEventForm").submit(); + cy.get("#attendees-alert").should("contain.text", "8 spots remaining"); + cy.get(".attendeesList").should("contain.text", "Test Attendee (2 people)"); + }); + + it("allows you to comment on an event", function () { + cy.get("#commentAuthor").type("Test Author"); + cy.get("#commentContent").type("Test Comment"); + cy.get("#postComment").click(); + cy.get(".comment").should("contain.text", "Test Author"); + cy.get(".comment").should("contain.text", "Test Comment"); + }); }); -- cgit v1.2.3