refactor: Replace attendee email with user id in idempotency key (#21058)

* Use userId instead of attendee email

* Only write if booking is accepted

* Create `getBookingRequest` function

* Return already requested booking

* Type fixes

* Type fix

* Type fix

* Pass empty seatReferenceId

* Handle no userId

* Update test
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2025-05-02 00:46:19 +01:00
1 parent eedef35d02
commit 6fffe3377d
4 files changed
+101 -37

No files matched your search

+6 -3
View File
@@ -287,7 +287,10 @@ test.describe("pro user", () => {
await expect(page.locator("[data-testid=success-page]")).toBeVisible();
});
test("cannot book an unconfirmed event multiple times with the same email", async ({ page, users }) => {
test("booking an unconfirmed event with the same email brings you to the original request", async ({
page,
users,
}) => {
await page.locator('[data-testid="event-type-link"]:has-text("Opt in")').click();
await selectFirstAvailableTimeSlotNextMonth(page);
@@ -297,8 +300,8 @@ test.describe("pro user", () => {
// go back to the booking page to re-book.
await page.goto(pageUrl);
await bookTimeSlot(page, { expectedStatusCode: 409 });
await expect(page.getByText("Could not book the meeting.")).toBeVisible();
await bookTimeSlot(page);
await expect(page.locator("[data-testid=success-page]")).toBeVisible();
});
test("can book with multiple guests", async ({ page, users }) => {