75 lines
No EOL
2.6 KiB
TypeScript
75 lines
No EOL
2.6 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 essentialReplaceNonAdasData: Partial<ITestData> = {
|
|
clientTag: 'ALL_ESSENTIAL',
|
|
isDuplicateClaim: false,
|
|
isPolicyFound: false,
|
|
endorsements: [],
|
|
isReplace: false,
|
|
partQuestions: undefined,
|
|
isSafelite: true,
|
|
bailoutFlags: {
|
|
isPartsServiceErrorBailout: true
|
|
},
|
|
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]/),
|
|
notes: 'Automated Test',
|
|
address: {
|
|
street: faker.location.streetAddress(),
|
|
city: 'Tulare',
|
|
state: 'CALIFORNIA',
|
|
postalCode: '93247',
|
|
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: '2012',
|
|
make: 'Dodge',
|
|
model: 'Charger',
|
|
style: '4 door sedan',
|
|
vin: '2C3CDXBG6CH260654',
|
|
vehicleLookupType: VehicleLookupType.Vin
|
|
},
|
|
vehicleDamage: [
|
|
VehicleDamage.WindshieldCrack,
|
|
],
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.InShop,
|
|
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
|
appointmentDate: nextWeekday
|
|
}
|
|
|
|
}
|
|
|
|
const essentialClients = ClientData.getEssentialClients();
|
|
const essentialReplaceNonAdasTests: TestCase[] = [];
|
|
for (const client of essentialClients) {
|
|
const data = {...essentialReplaceNonAdasData};
|
|
data.clientTag = client.clientTag;
|
|
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
|
const tc = new TestCase({
|
|
name: `0009 Essential Replace Non ADAS Client: "${client.accountName}"`,
|
|
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Essentials','@0009'],
|
|
testData: data
|
|
}, undefined, '0009');
|
|
essentialReplaceNonAdasTests.push(tc);
|
|
}
|
|
|
|
export default essentialReplaceNonAdasTests; |