feat: Redirect when event type does not match booking type (#14460)

* feat: Redirect when event type does not match booking type

* Favour early return

* If multiple bookingUid/rescheduleUid given, use first

* rescheduleUid/bookingUid behaviour is required
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-05-08 10:33:22 -03:00
1 parent 5d7b2a12a7
commit c5bd45fdfb
5 files changed
+152 -55

No files matched your search

+15
View File
@@ -126,6 +126,21 @@ testBothFutureAndLegacyRoutes.describe("pro user", () => {
});
});
test("it redirects when a rescheduleUid does not match the current event type", async ({
page,
users,
bookings,
}) => {
const [pro] = users.get();
const [eventType] = pro.eventTypes;
const bookingFixture = await bookings.create(pro.id, pro.username, eventType.id);
// open the wrong eventType (rescheduleUid created for /30min event)
await page.goto(`${pro.username}/${pro.eventTypes[1].slug}?rescheduleUid=${bookingFixture.uid}`);
await expect(page).toHaveURL(new RegExp(`${pro.username}/${eventType.slug}`));
});
test("Can cancel the recently created booking and rebook the same timeslot", async ({
page,
users,