fix: handle cancelation reason when user is host (#18681)
* handle cancelation reason when user is host * add attendee reason warning * add cancellation reason to tests when we are the host * req.body and not req * fix: isloggedIn logic * use new isLoggedInUser from ssr instead of client * update e2e tests to fill in reason when hosts --------- Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
9 files changed
+53
-8
No files matched your search
@@ -175,6 +175,8 @@ test.describe("pro user", () => {
|
||||
await page.waitForURL((url) => {
|
||||
return url.pathname.startsWith("/booking/");
|
||||
});
|
||||
|
||||
await page.locator('[data-testid="cancel_reason"]').fill("Test reason");
|
||||
await page.locator('[data-testid="confirm_cancel"]').click();
|
||||
|
||||
const cancelledHeadline = page.locator('[data-testid="cancelled-headline"]');
|
||||
@@ -205,6 +207,7 @@ test.describe("pro user", () => {
|
||||
await page.waitForURL((url) => {
|
||||
return url.pathname.startsWith("/booking/");
|
||||
});
|
||||
await page.locator('[data-testid="cancel_reason"]').fill("Test reason");
|
||||
await page.locator('[data-testid="confirm_cancel"]').click();
|
||||
|
||||
const cancelledHeadline = page.locator('[data-testid="cancelled-headline"]');
|
||||
|
||||
@@ -228,6 +228,8 @@ test.describe("Reschedule for booking with seats", () => {
|
||||
`/booking/${booking.uid}?cancel=true&allRemainingBookings=false&seatReferenceUid=${bookingSeats[0].referenceUid}`
|
||||
);
|
||||
|
||||
await page.locator('[data-testid="cancel_reason"]').fill("Test reason");
|
||||
|
||||
await page.locator('[data-testid="confirm_cancel"]').click();
|
||||
|
||||
await expect(page.locator("text=You are no longer attending this event")).toBeVisible();
|
||||
@@ -236,6 +238,8 @@ test.describe("Reschedule for booking with seats", () => {
|
||||
`/booking/${booking.uid}?cancel=true&allRemainingBookings=false&seatReferenceUid=${bookingSeats[1].referenceUid}`
|
||||
);
|
||||
|
||||
await page.locator('[data-testid="cancel_reason"]').fill("Test reason");
|
||||
|
||||
// Page should not be 404
|
||||
await page.locator('[data-testid="confirm_cancel"]').click();
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ test("dynamic booking", async ({ page, users }) => {
|
||||
await page.waitForURL((url) => {
|
||||
return url.pathname.startsWith("/booking");
|
||||
});
|
||||
await page.locator('[data-testid="cancel_reason"]').fill("Test reason");
|
||||
await page.locator('[data-testid="confirm_cancel"]').click();
|
||||
|
||||
const cancelledHeadline = page.locator('[data-testid="cancelled-headline"]');
|
||||
|
||||
Reference in new issue
Block a user