fix: don't allow seats for recurring events (#19257)

* fix: Don't allow seats for recurring events #19061

* update the commit with English

* Update common.json

* Update common.json

* Update common.json

* Add edge case when people have already enabled seats as well as recurring event

* fix type issue

* Handle case where seats and recurring is already enabled

* minor fix

* minor change

* typo

* Block backend functionality

* blocking new booking and other enhancements

* final-changes

* minor-changes

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Tushar Bhatt <[email protected]>
Co-authored-by: Tushar <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-04-15 21:07:57 +00:00
1 parent 3e466022b8
commit 58315e96c9
8 files changed
+108 -4

No files matched your search

+33
View File
@@ -658,3 +658,36 @@ test.describe("Event type with disabled cancellation and rescheduling", () => {
expect(responseBody.message).toBe("This event type does not allow cancellations");
});
});
test("Should throw error when both seatsPerTimeSlot and recurringEvent are set", async ({ page, users }) => {
const user = await users.create({
name: `Test-user-${randomString(4)}`,
eventTypes: [
{
title: "Seats With Recurrence",
slug: "seats-with-recurrence",
length: 30,
seatsPerTimeSlot: 3,
recurringEvent: {
freq: 1,
count: 4,
interval: 1,
},
},
],
});
// Way to book the event
await page.goto(`/${user.username}/seats-with-recurrence`);
await selectFirstAvailableTimeSlotNextMonth(page);
await page.locator('[name="name"]').fill("Test name");
await page.locator('[name="email"]').fill(`${randomString(4)}@example.com`);
page.locator("[data-testid=confirm-book-button]").click();
// Expect an error message to be displayed
const alertError = page.locator("[data-testid=booking-fail]");
await expect(alertError).toBeVisible();
await expect(alertError).toContainText(
"Could not book the meeting. Recurring event doesn't support seats feature. Disable seats feature or make the event non-recurring."
);
});
+33
View File
@@ -387,6 +387,39 @@ test.describe("Event Types tests", () => {
await unCheckDisplayLocation(page);
});
});
test("Should not allow enabling both recurring event and offer seats at the same time", async ({
page,
}) => {
const nonce = randomString(3);
const eventTitle = `Conflict event ${nonce}`;
await createNewEventType(page, { eventTitle });
await page.goto("/event-types");
await page.click(`text=${eventTitle}`);
// Go to Advanced tab and enable offerSeats
await page.click("[data-testid=vertical-tab-event_advanced_tab_title]");
const offerSeatsToggle = page.locator("[data-testid=offer-seats-toggle]");
await offerSeatsToggle.click();
// Try enabling recurring - should be disabled
await page.click("[data-testid=vertical-tab-recurring]");
const recurringEventToggle = page.locator("[data-testid=recurring-event-check]");
await expect(recurringEventToggle).toBeDisabled();
// Go back and disable offerSeats
await page.click("[data-testid=vertical-tab-event_advanced_tab_title]");
await offerSeatsToggle.click(); // turn it off
// Enable recurring now
await page.click("[data-testid=vertical-tab-recurring]");
await recurringEventToggle.click();
await expect(page.locator("[data-testid=recurring-event-collapsible]")).toBeVisible();
// After enabling recurring, offerSeats should now be disabled
await page.click("[data-testid=vertical-tab-event_advanced_tab_title]");
await expect(offerSeatsToggle).toBeDisabled();
});
});
});
@@ -3053,6 +3053,9 @@
"tip_username_plus": "Tip: You can a '+' between usernames: cal.com/anna+brian to make a dynamic group meeting",
"user_has_no_team_yet": "You don't have a team yet",
"no_team_members": "You don't have team members yet",
"recurring_event_doesnt_support_seats": "Recurring event doesn't support seats feature. Make it non-recurring to enable seats.",
"seats_doesnt_support_recurring": "Seats feature doesn't support recurring event. Disable seats feature to make it recurring.",
"recurring_event_seats_error": "Recurring event doesn't support seats feature. Disable seats feature or make the event non-recurring.",
"segment": "Segment",
"rename": "Rename",
"rename_segment": "Rename Segment",