import {
  happyBookingCreateTestData,
  unhappyBookingCreateTestData,
} from '@/manager/modules/booking/data/booking-create-test-data';
import { test } from '@/manager/modules/booking/booking-fixtures';
import {
  expectBookingToBeCreated,
  expectBookingToNotBeCreated,
} from '@/manager/modules/booking/utils/booking-create-expect-utils';

// TODO: due to Stripe concurrency issues the booking create tests must be run sequentially for now

test.describe.configure({ mode: 'default' });

for (const data of happyBookingCreateTestData) {
  test(data.description, async ({ bookingListPage }) => {
    await expectBookingToBeCreated(bookingListPage, data.booking);
  });
}

for (const data of unhappyBookingCreateTestData) {
  test(data.description, async ({ bookingListPage }) => {
    await expectBookingToNotBeCreated(bookingListPage, data.booking);
  });
}
