test: Add E2E tests for seated attendee rescheduling or cancelling bookings#9422
test: Add E2E tests for seated attendee rescheduling or cancelling bookings#9422roae merged 12 commits intocalcom:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@rjackson is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
| // TODO: Find out why the first day is always booked on tests | ||
| await page.locator('[data-testid="day"][data-disabled="false"]').nth(1).click(); | ||
| await page.locator('[data-testid="time"]').nth(0).click(); | ||
| await page.locator('[data-testid="time"][data-disabled="false"]').nth(0).click(); |
|
@rjackson I'm trying to replicate the issue canceling the booking with the endpoint |
Hmm, I thought I got that link from the emails that go out – but looking at it again, I can see that emails use cal.com/packages/lib/CalEventParser.ts Line 177 in 09b29ac I can't find anywhere else that might cause it, unless it somehow ever ends up as Maybe the reschedule usage is where I originally saw this type of URL structure and then later noticed that I'd say that lowers the priority of the "bug", but I would point out that Whatever we decide, as this URL appears to be an unexposed "feature"/"bug" I don't think we ought to have it represented in these tests. That can change if we ever do decide to formally support it, of course. |
What does this PR do?
This PR adds or expands end-to-end tests to cover cancellation or reschedule actions taken by the attendees or seated events:
There are a few other small changes and fixes alongside this PR:
This was a problem whilst I was exploring non-seated event tests, as I had misunderstood the scope of these issues. Whilst it caused no breakages at present, the test utils should be able to skip disabled time slots in the new booking UI
The same
testidwas in-use by two cancel buttons: One which opens the form with "Cancellation reason", and the other that actually submits the cancel. For clarity and to ease future test writing, I've given these separate IDs. I also added atestidfor the "Cancellation reason" fieldbookingFieldsto avoid loading attendees as "guests" for event types with guests disabled (which is the case for seated bookings)This caused a lot of trouble when I was expanding the "reschedule" test to ensure the rescheduled attendee's booking was created correctly. According to my expanded test it was not, but when manually testing it was – with this backward-compatibility logic being responsible for that difference.
(Following section struck out as it relates to unused functionality)
And there remains one major issue, left unaddressed by this PR: Cancelling a booking from the `/booking/${seatRef}` endpoint doesn't work correctly, it:- Cancels the whole booking for all attendees (very unpleasant!)
2.~Shows a 404 page to the user instead of the "You are no longer attending this event" messaging ([CAL-1482] Booking not found error on cancel link for user with seat #8244)
I have written the cancellation-related tests to cover both the
/booking/${bookingRef}?seatReferenceUid=${seatRef}URL and the seatRef URL, but left the seatRef tests being skipped default.The seatRef tests can be enabled by running the tests with
E2E_TEST_SEATED_CANCELLATIONS=1, for example to run just those tests:Fixes #9362 #9363 #9364
/claim #9362
/claim #9363
/claim #9364
Type of change
How should this be tested?
Mandatory Tasks
Checklist
(all complete)