summaryrefslogtreecommitdiff
path: root/cypress/e2e/event.cy.ts
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@hey.com>2023-10-10 15:50:33 +0100
committerRaphael Kabo <raphaelkabo@hey.com>2023-10-10 15:50:33 +0100
commit61a0c53b7b82bc875c855358df2c81c91e7e5a94 (patch)
treeb0741471592cad5a760173a25ed39564e3443ee6 /cypress/e2e/event.cy.ts
parent2f4ffd5d86aa695afaffed9c6780f695d0bfde9d (diff)
Update Cypress tests
Diffstat (limited to 'cypress/e2e/event.cy.ts')
-rw-r--r--cypress/e2e/event.cy.ts34
1 files changed, 30 insertions, 4 deletions
diff --git a/cypress/e2e/event.cy.ts b/cypress/e2e/event.cy.ts
index 1160586..270ca0a 100644
--- a/cypress/e2e/event.cy.ts
+++ b/cypress/e2e/event.cy.ts
@@ -7,8 +7,6 @@ const eventData = {
hostName: "Your Name",
creatorEmail: "test@example.com",
eventGroupCheckbox: false,
- eventGroupID: "YourEventGroupID",
- eventGroupEditToken: "YourEventGroupEditToken",
interactionCheckbox: true,
joinCheckbox: true,
maxAttendeesCheckbox: true,
@@ -28,7 +26,7 @@ describe("Events", () => {
cy.get("#eventStart").type(eventData.eventStart);
cy.get("#eventEnd").type(eventData.eventEnd);
- cy.get(".select2-container").click();
+ cy.get("select#timezone + span.select2").click();
cy.get(".select2-results__option")
.contains(eventData.timezone)
.click({ force: true });
@@ -177,7 +175,7 @@ describe("Events", () => {
cy.get("#editEventForm #eventStart").type("2030-12-01T00:00");
cy.get("#editEventForm #eventEnd").type("2030-12-01T01:00");
- cy.get("#editEventForm .select2-container").click();
+ cy.get("#editEventForm select#timezone + span.select2").click();
cy.get(".select2-results__option")
.contains("Australia/Sydney")
.click({ force: true });
@@ -218,4 +216,32 @@ describe("Events", () => {
// Check that the attendee form is not visible
cy.get("#attendEvent").should("not.exist");
});
+
+ it("sets a group for an event", function () {
+ // For this we need to create a group first. This will load the group edit token
+ // into our localStorage, and will then appear in the group select dropdown.
+ // We then go back to the event page, edit the event, and set the group.
+ cy.createGroup({
+ eventGroupName: "Test Group",
+ eventGroupDescription: "Test Group Description",
+ eventGroupURL: "testgroup",
+ hostName: "Test Host",
+ creatorEmail: "test@example.com",
+ });
+
+ cy.visit(`/${this.eventID}`);
+ cy.url().should("include", this.editToken);
+
+ cy.get("#editEvent").click();
+ cy.get("#editEventForm #eventGroupCheckbox").check();
+ cy.get("select#eventGroupSelect + span.select2").click();
+ cy.get(".select2-results__option")
+ .contains("Test Group")
+ .click({ force: true });
+ cy.get("#editEventForm").submit();
+
+ cy.get("#editModal").should("not.be.visible");
+
+ cy.get("#event-group").should("contain.text", "Test Group");
+ });
});