summaryrefslogtreecommitdiff
path: root/cypress/support/commands.ts
diff options
context:
space:
mode:
authorRaphael <mail@raphaelkabo.com>2024-02-26 15:06:01 +0000
committerGitHub <noreply@github.com>2024-02-26 15:06:01 +0000
commitde688444d167fdb80c6e88b8ba837405ba7651a6 (patch)
tree051fa37a2fe30052254bf79a60bd870667fcc0b7 /cypress/support/commands.ts
parentafd9fc4477fff90e5db917f350d99c3d01fba2bd (diff)
parent1275280a9e3a31f6080079d564a8fb9e1847db8b (diff)
Merge pull request #135 from lowercasename/rk/public-events
Events and groups optionally visible on front page
Diffstat (limited to 'cypress/support/commands.ts')
-rw-r--r--cypress/support/commands.ts23
1 files changed, 15 insertions, 8 deletions
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
index 7535103..eadcd20 100644
--- a/cypress/support/commands.ts
+++ b/cypress/support/commands.ts
@@ -38,17 +38,20 @@
declare namespace Cypress {
interface Chainable<Subject> {
- createGroup(groupData: {
- eventGroupName: string;
- eventGroupDescription: string;
- eventGroupURL: string;
- hostName: string;
- creatorEmail: string;
- }): Chainable<Subject>;
+ createGroup(
+ groupData: {
+ eventGroupName: string;
+ eventGroupDescription: string;
+ eventGroupURL: string;
+ hostName: string;
+ creatorEmail: string;
+ },
+ isPublic: boolean,
+ ): Chainable<Subject>;
}
}
-Cypress.Commands.add("createGroup", (groupData) => {
+Cypress.Commands.add("createGroup", (groupData, isPublic) => {
cy.visit("/new");
cy.get("#showNewEventGroupFormButton").click();
@@ -59,6 +62,10 @@ Cypress.Commands.add("createGroup", (groupData) => {
cy.get("#eventGroupHostName").type(groupData.hostName);
cy.get("#eventGroupCreatorEmail").type(groupData.creatorEmail);
+ if (isPublic) {
+ cy.get("#publicGroupCheckbox").check();
+ }
+
// Submit the form
cy.get("#newEventGroupForm").submit();