81 lines
2.9 KiB
TypeScript
81 lines
2.9 KiB
TypeScript
import ClientData from "@business-logic/data/ClientData";
|
|
import TestCase from "@business-logic/types/TestCase";
|
|
import { DamageType, PartQuestionType, 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 essentialServiceableBigTruckData: Partial<ITestData> = {
|
|
clientTag: 'ALL_ESSENTIAL',
|
|
isDuplicateClaim: false,
|
|
isPolicyFound: false,
|
|
endorsements: [],
|
|
isReplace: true,
|
|
bailoutFlags: {
|
|
isHeavyTruckVehicleBailout: true,
|
|
},
|
|
vehiclePartQuestions: [
|
|
{
|
|
partQuestionType: PartQuestionType.WindshieldColor,
|
|
isOnPage: true,
|
|
optionToSelect: 'One-Piece, With Lane Departure Warning System',
|
|
},
|
|
],
|
|
isSafelite: 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]{3}-[0-9]{4}/),
|
|
notes: 'Automated Test',
|
|
address: {
|
|
street: '9799 Heartland Court',
|
|
city: 'Dublin',
|
|
state: 'OHIO',
|
|
postalCode: '43016',
|
|
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: '2021',
|
|
make: 'Freightliner',
|
|
model: 'Cascadia',
|
|
style: 'conventional cab',
|
|
vin: '3AKJHPDV7MSLJ2958',
|
|
vehicleLookupType: VehicleLookupType.Vin,
|
|
},
|
|
vehicleDamage: [
|
|
VehicleDamage.WindshieldCrackSingleWindshield,
|
|
],
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.InShop,
|
|
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
|
appointmentDate: nextWeekday
|
|
},
|
|
isUseVehicleOnPolicy: false,
|
|
}
|
|
|
|
const essentialClients = ClientData.getEssentialClients();
|
|
const essentialServiceableBigTruckTestCases: TestCase[] = [];
|
|
for (const client of essentialClients) {
|
|
const data = { ...essentialServiceableBigTruckData };
|
|
data.clientTag = client.clientTag;
|
|
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
|
const tc = new TestCase({
|
|
name: `0022 Essential Serviceable Big Truck Client: "${client.accountName}"`,
|
|
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@BigTruck', '@Essentials'],
|
|
testData: data
|
|
}, undefined, '0022');
|
|
essentialServiceableBigTruckTestCases.push(tc);
|
|
}
|
|
|
|
export default essentialServiceableBigTruckTestCases;
|