80 lines
No EOL
2.9 KiB
TypeScript
80 lines
No EOL
2.9 KiB
TypeScript
import ClientData from "@business-logic/data/ClientData";
|
|
import TestCase from "@business-logic/types/TestCase";
|
|
import { DamageType, ServiceLocation, ServicePackage, VehicleDamage, VehicleLookupType, PartQuestionType } 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 essentialPartQuestionsAndNotShareVinData: Partial<ITestData> = {
|
|
clientTag: 'ALL_ESSENTIAL',
|
|
isDuplicateClaim: false,
|
|
isPolicyFound: false,
|
|
endorsements: [],
|
|
isReplace: false,
|
|
partQuestions: [
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion1,
|
|
isOnPage: true,
|
|
optionToSelect: 'Yes'
|
|
},
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion2,
|
|
isOnPage: true,
|
|
optionToSelect: 'Yes'
|
|
}
|
|
],
|
|
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][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
|
|
notes: 'Automated Test',
|
|
address: {
|
|
street: '6400 Emerald Parkway',
|
|
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: '2020',
|
|
make: 'BMW',
|
|
model: '740',
|
|
style: '4 door sedan',
|
|
vehicleLookupType: VehicleLookupType.RatherNotShareVin,
|
|
},
|
|
vehicleDamage: [VehicleDamage.WindshieldCrack],
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.InShop,
|
|
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
|
appointmentDate: nextWeekday
|
|
}
|
|
|
|
}
|
|
|
|
const essentialClients = ClientData.getEssentialClients();
|
|
const essentialPartQuestionsAndNotShareVinTests: TestCase[] = [];
|
|
for (const client of essentialClients) {
|
|
const data = {...essentialPartQuestionsAndNotShareVinData};
|
|
data.clientTag = client.clientTag;
|
|
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
|
const tc = new TestCase({
|
|
name: `0020 Essential Part Questions and Not Share Vin Client: "${client.accountName}"`,
|
|
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@VehicleLookup', '@Essentials'],
|
|
testData: data
|
|
}, undefined, '0020');
|
|
essentialPartQuestionsAndNotShareVinTests.push(tc);
|
|
}
|
|
|
|
export default essentialPartQuestionsAndNotShareVinTests; |