import {
  happyBookingCreateTestData,
  happyNeighboringUnitBookingCreateTestData,
  unhappyDeclinedPaymentBookingCreateTestData,
  unhappyNeighboringUnitBookingCreateTestData,
} from '@/apps/portal/modules/booking/data/booking-create-test-data';
import { test } from '@/apps/portal/modules/booking/fixtures/booking-fixtures';
import {
  expectBookingNotToBeCreatedDueToDeclinedPayment,
  expectBookingNotToBeCreatedWithNeighboringUnit,
  expectBookingToBeCreated,
  expectBookingToBeCreatedWithNeighboringUnit,
} from '@/apps/portal/modules/booking/utils/booking-expect-utils';

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

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

for (const data of unhappyDeclinedPaymentBookingCreateTestData) {
  test(data.description, async ({ bookingLocationView, isMobile }) => {
    await expectBookingNotToBeCreatedDueToDeclinedPayment(bookingLocationView, data.booking, isMobile);
  });
}

for (const data of happyNeighboringUnitBookingCreateTestData) {
  test(data.description, async ({ bookingLocationView, isMobile }) => {
    await expectBookingToBeCreatedWithNeighboringUnit(bookingLocationView, data.booking, data.notAvailable, isMobile);
  });
}

for (const data of unhappyNeighboringUnitBookingCreateTestData) {
  test(data.description, async ({ bookingLocationView }) => {
    await expectBookingNotToBeCreatedWithNeighboringUnit(bookingLocationView, data.booking, data.notAvailable);
  });
}
