Conversation
WalkthroughUpdates E2E tests and fixtures:
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
E2E results are ready! |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/playwright/booking-seats.e2e.ts (1)
544-548: Add null-safety assertion for the second attendee.The
.find()can returnundefinedif the attendee is not found. While the optional chaining (?.) handles this, the test would fail later with a less clear error. Add an explicit assertion to fail early with a clear message.Apply this diff:
const secondAttendeeId = bookingAttendees.find((attendee)=> attendee.email === "second+seats@cal.com"); +expect(secondAttendeeId).toBeDefined(); const references = await prisma.bookingSeat.findFirst({ where: { bookingId: booking.id, attendeeId: secondAttendeeId?.id }, });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/web/playwright/booking-seats.e2e.ts(2 hunks)apps/web/playwright/fixtures/apps.ts(2 hunks)apps/web/playwright/out-of-office.e2e.ts(2 hunks)apps/web/playwright/payment-apps.e2e.ts(9 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
apps/web/playwright/payment-apps.e2e.tsapps/web/playwright/out-of-office.e2e.tsapps/web/playwright/fixtures/apps.tsapps/web/playwright/booking-seats.e2e.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
apps/web/playwright/payment-apps.e2e.tsapps/web/playwright/out-of-office.e2e.tsapps/web/playwright/fixtures/apps.tsapps/web/playwright/booking-seats.e2e.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
apps/web/playwright/payment-apps.e2e.tsapps/web/playwright/out-of-office.e2e.tsapps/web/playwright/fixtures/apps.tsapps/web/playwright/booking-seats.e2e.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Publish HTML report / publish-report
🔇 Additional comments (7)
apps/web/playwright/fixtures/apps.ts (2)
118-121: LGTM! Improved race condition handling.The explicit
aria-current="page"assertion after navigation ensures the Apps tab is fully active before proceeding, reducing flakiness.
128-132: LGTM! Consistent tab-state verification.The change aligns with the updated
goToAppsTabflow by verifying the Apps tab is active rather than the Basics tab, and the comment clarifies this fixes a race condition.apps/web/playwright/out-of-office.e2e.ts (2)
656-661: LGTM! Proper response promise handling.Creating the response promise before navigation and awaiting it after
domcontentloadedprevents race conditions where the API response might complete before the listener is registered.
671-676: LGTM! Consistent pattern applied.The same race condition fix is applied here, ensuring consistent and reliable test behavior.
apps/web/playwright/payment-apps.e2e.ts (2)
12-15: LGTM! Centralized navigation helper.The
goToAppsTabhelper encapsulates navigation and tab-state verification, reducing duplication and ensuring consistent race condition handling across all tests.
38-38: LGTM! Consistent use of the navigation helper.Replacing direct
page.goto()calls withgoToAppsTab()ensures all tests benefit from the centralized navigation and assertion logic.Also applies to: 84-84, 124-124, 167-167, 194-194, 229-229, 276-276, 323-323
apps/web/playwright/booking-seats.e2e.ts (1)
560-566: LGTM! Robust URL parameter validation.Extracting and validating the
seatReferenceUidfrom the reschedule link before navigation is a good pattern that ensures the correct reference is used, preventing flakiness from incorrect URL parameters.
What does this PR do?
fixed flaky e2e tests