87 lines
No EOL
3.1 KiB
TypeScript
87 lines
No EOL
3.1 KiB
TypeScript
import ClientData from "@business-logic/data/ClientData";
|
|
import TestCase from "@business-logic/types/TestCase";
|
|
import { DamageType, ServiceLocation, ServicePackage, VehicleDamage, VehicleLookupType } from "@business-logic/types/Enums";
|
|
import { ITestData } from "@business-logic/types/ITestData"
|
|
import { faker } from "@faker-js/faker";
|
|
import { getNextWeekday } from "@impl/utils/DateUtils";
|
|
|
|
const nextWeekday = getNextWeekday();
|
|
|
|
const essentialTpaEnabledData: Partial<ITestData> = {
|
|
clientTag: 'ALL_ESSENTIAL',
|
|
isDuplicateClaim: false,
|
|
isPolicyFound: false,
|
|
endorsements: [],
|
|
isReplace: true,
|
|
partQuestions: undefined,
|
|
isSafelite: true,
|
|
isRecalNotification: false,
|
|
isRecalWarning: true,
|
|
bailoutFlags: {
|
|
isTpaNotEnabledBailout: false
|
|
},
|
|
|
|
servicePackage: faker.helpers.enumValue(ServicePackage),
|
|
customerDetails: {
|
|
firstName: faker.person.firstName(),
|
|
lastName: faker.person.lastName(),
|
|
email: "itqatest@safelite.com",
|
|
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
|
|
// phoneNumber: faker.phone.toString(),
|
|
notes: 'Automated Test',
|
|
address: {
|
|
street: '1st St',
|
|
city: 'Jacksonville Beach',
|
|
state: 'FLORIDA',
|
|
postalCode: '32250',
|
|
country: 'United States'
|
|
}
|
|
},
|
|
claimDetails: {
|
|
policyNumber: faker.string.alphanumeric(5),
|
|
policyDeductible: -1, // Not advanced, so we don't care about deductible.
|
|
damageDate: '2024-10-10',
|
|
damageCause: DamageType.Other
|
|
},
|
|
vehicleDetails: {
|
|
year: '2020',
|
|
make: 'Acura',
|
|
model: 'ILX',
|
|
style: '4 door sedan',
|
|
vin: '19UDE2F38LA001705',
|
|
vehicleLookupType: VehicleLookupType.Vin,
|
|
},
|
|
vehicleDamage: [
|
|
// VehicleDamage.WindshieldThreeChips,
|
|
VehicleDamage.WindshieldCrack,
|
|
// VehicleDamage.DriverFrontDoor,
|
|
// VehicleDamage.DriverQuarterPanel,
|
|
// VehicleDamage.DriverRearDoor,
|
|
// VehicleDamage.PassengerFrontDoor,
|
|
// VehicleDamage.PassengerQuarterPanel,
|
|
// VehicleDamage.PassengerRearDoor,
|
|
// VehicleDamage.RearWindow
|
|
],
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.DropOff,
|
|
shopAddress: undefined,
|
|
appointmentDate: nextWeekday
|
|
}
|
|
|
|
}
|
|
|
|
const essentialClients = ClientData.getEssentialClients();
|
|
const essentialTpaEnabledReplaceAdasTests: TestCase[] = [];
|
|
for (const client of essentialClients) {
|
|
const data = { ...essentialTpaEnabledData };
|
|
data.clientTag = client.clientTag;
|
|
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
|
const tc = new TestCase({
|
|
name: `0019 Essential TPA Enabled Client with Replace ADAS: "${client.accountName}"`,
|
|
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Recal', '@Essentials', '@0019'],
|
|
testData: data
|
|
}, undefined, '0019');
|
|
essentialTpaEnabledReplaceAdasTests.push(tc);
|
|
}
|
|
|
|
export default essentialTpaEnabledReplaceAdasTests; |