fix: and enable dynamic booking test (#10642)

* fix and enable dynamic booking test

* remove page pause

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
alannnc 2023-08-11 13:33:24 -07:00 committed by GitHub
parent afe180a0ec
commit 4d5697f5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -9,10 +9,7 @@ import {
test.afterEach(({ users }) => users.deleteAll());
// Due to some reason for Dynamic booking cancellation, daily video api_key is not set which causes cancellation to fail.
// This test is skipped until the issue is resolved in GH actions.
// eslint-disable-next-line playwright/no-skipped-test
test.skip("dynamic booking", async ({ page, users }) => {
test("dynamic booking", async ({ page, users }) => {
const pro = await users.create();
await pro.apiLogin();
@ -20,10 +17,13 @@ test.skip("dynamic booking", async ({ page, users }) => {
await page.goto(`/${pro.username}+${free.username}`);
await test.step("book an event first day in next month", async () => {
// Click first event type
await page.click('[data-testid="event-type-link"]');
await selectFirstAvailableTimeSlotNextMonth(page);
// Fill what is this meeting about? title
await page.locator('[name="title"]').fill("Test meeting");
await bookTimeSlot(page);
await expect(page.locator("[data-testid=success-page]")).toBeVisible();
});
@ -37,7 +37,8 @@ test.skip("dynamic booking", async ({ page, users }) => {
return !!bookingId;
});
await selectSecondAvailableTimeSlotNextMonth(page);
// --- fill form
// No need to fill fields since they should be already filled
await page.locator('[data-testid="confirm-reschedule-button"]').click();
await page.waitForURL((url) => {
return url.pathname.startsWith("/booking");

View File

@ -119,8 +119,8 @@ export const getBookingForReschedule = async (uid: string) => {
},
});
// If no booking is found via the uid, it's probably a booking seat,
// which we query next.
// If no booking is found via the uid, it's probably a booking seat
// that its being rescheduled, which we query next.
let attendeeEmail: string | null = null;
if (!theBooking) {
const bookingSeat = await prisma.bookingSeat.findFirst({