Skip to content

Commit ed0c939

Browse files
fix: E2E flakes after splitting the tests (calcom#26059)
* fix: split confirm-emails e2e test to authenticate as booking owner The test was flaky because it authenticated as an admin user (authEmail) but created bookings for different users (emailsEnabledSetup.user and emailsDisabledSetup.user). When confirming/declining bookings, the ApiAuthGuard + BookingUidGuard rejected requests with 401 because the authenticated user wasn't the booking owner. The fix splits the test into two separate describe blocks, each with its own app instance that authenticates as the actual booking owner. This ensures the authenticated user always matches the booking owner. Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * fix: add unauthenticated app for attendee reschedule test Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * fix: use real API key authentication instead of withApiAuth mock - Replace withApiAuth mock with real API key authentication using ApiKeysRepositoryFixture - This avoids Passport strategy registration conflicts between test suites - For attendee reschedule test, use unauthenticated request (no auth header) since endpoint uses OptionalApiAuthGuard - Remove separate unauthenticatedApp instance as it's no longer needed Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * fix flakes * update --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 0098b07 commit ed0c939

2 files changed

Lines changed: 347 additions & 287 deletions

File tree

apps/web/playwright/event-types.e2e.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ test.describe("Event Types tests", () => {
182182
* Verify first organizer address
183183
*/
184184
await page.goto(previewLink ?? "");
185+
await page.waitForURL((url) => {
186+
return url.searchParams.get("overlayCalendar") === "true";
187+
});
185188
await selectFirstAvailableTimeSlotNextMonth(page);
186189
await page.locator(`span:has-text("${locationData[0]}")`).click();
187190
await bookTimeSlot(page);

0 commit comments

Comments
 (0)