import {
  happyCustomerCreateTestData,
  unhappyCustomerCreateTestData,
} from '@/manager/modules/customer/data/customer-create-test-data';
import { test } from '@/manager/modules/customer/customer-fixtures';
import {
  expectCustomerToBeCreated,
  expectCustomerToNotBeCreated,
} from '@/manager/modules/customer/utils/customer-create-expect-utils';
import { getRandomCustomerCreateFormData } from '@/manager/modules/customer/utils/customer-create-faker-utils';

for (const data of happyCustomerCreateTestData) {
  test(data.description, async ({ customerListPage }) => {
    const customer = getRandomCustomerCreateFormData(data.seeder);
    await expectCustomerToBeCreated(customerListPage, customer);
  });
}

for (const data of unhappyCustomerCreateTestData) {
  test(data.description, async ({ customerListPage }) => {
    const customer = getRandomCustomerCreateFormData(data.seeder);
    await expectCustomerToNotBeCreated(customerListPage, customer);
  });
}
