Update unit test
This commit is contained in:
parent
51655e7247
commit
fad42eba6e
1 changed files with 104 additions and 0 deletions
|
|
@ -3950,6 +3950,110 @@ describe("Getters", () => {
|
||||||
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
|
funnelVehicleYear: mockStateValues.vehicleYear,
|
||||||
|
funnelVehicleMake: mockStateValues.vehicleMake,
|
||||||
|
funnelVehicleModel: mockStateValues.vehicleModel,
|
||||||
|
funnelVehicleStyle: mockStateValues.vehicleStyle,
|
||||||
|
funnelIsRepair: mockStateValues.isRepair,
|
||||||
|
funnelNumberOfChips: mockStateValues.numberOfChips,
|
||||||
|
funnelCarId: mockStateValues.carId,
|
||||||
|
funnelServiceCity: mockStateValues.serviceCity,
|
||||||
|
funnelServiceState: mockStateValues.serviceState,
|
||||||
|
funnelServiceZipCode: mockStateValues.serviceZipCode,
|
||||||
|
funnelParentAccountNumber: mockStateValues.parentAccountNumber,
|
||||||
|
funnelIsCoverageVerified: mockStateValues.isCoverageVerified,
|
||||||
|
funnelOrderPartNumbers: ["WINDSHIELDPARTNUMBER"],
|
||||||
|
funnelOrderPartTypes: ["ADAS, maybe"],
|
||||||
|
funnelHasRecalibrationPart: false,
|
||||||
|
funnelSelectedMultiGlass: false,
|
||||||
|
funnelSelectedWindshieldGlass: true,
|
||||||
|
funnelSelectedBackGlass: false,
|
||||||
|
funnelSelectedDriverSideGlass: false,
|
||||||
|
funnelSelectedPassengerSideGlass: false,
|
||||||
|
funnelProviderNumber: mockStateValues.funnelProviderNumber,
|
||||||
|
funnelReferralType: mockStateValues.funnelReferralType,
|
||||||
|
funnelServiceZipCodeCtu: mockStateValues.funnelServiceZipCodeCtu,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Single windshield with recalibration child part > return correct experimentOrder values", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockStateValues = {
|
||||||
|
vehicleYear: 1000,
|
||||||
|
vehicleMake: "CarMake",
|
||||||
|
vehicleModel: "CarModel",
|
||||||
|
vehicleStyle: "SuperCoolStyle",
|
||||||
|
isRepair: false,
|
||||||
|
numberOfChips: 0,
|
||||||
|
carId: "Gibberish",
|
||||||
|
serviceCity: "Columbus",
|
||||||
|
serviceState: "OH-IO",
|
||||||
|
serviceZipCode: 43215,
|
||||||
|
parentAccountNumber: "999999",
|
||||||
|
isCoverageVerified: false,
|
||||||
|
glassParts: [
|
||||||
|
{
|
||||||
|
partNumber: "WINDSHIELDPARTNUMBER",
|
||||||
|
description: "This is a windshield",
|
||||||
|
recalibrationType: "ADAS, maybe",
|
||||||
|
requiresRecalibration: true,
|
||||||
|
requiresCapabilityQuestions: false,
|
||||||
|
childParts: [
|
||||||
|
{
|
||||||
|
"partNumber": "THIRD RECAL",
|
||||||
|
"description": "Additional Static Recal",
|
||||||
|
"recalibrationType": "DUAL & RECAL THIRD & HC FUNCTION TEST & RL SENSOR",
|
||||||
|
"ribCode": "RL",
|
||||||
|
"safelitePartNumber": "THIRD RECAL",
|
||||||
|
"status": "ACTIVE",
|
||||||
|
"partType": "ADAS RECALIBRATION",
|
||||||
|
"childParts": [],
|
||||||
|
"recalibrationFees": [],
|
||||||
|
"salesTax": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
otherParts: [],
|
||||||
|
glassToReplace: [
|
||||||
|
{
|
||||||
|
glassLocation: "Windshield",
|
||||||
|
glassName: "Single",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
funnelProviderNumber: "1",
|
||||||
|
funnelReferralType: "CASH QUOTE",
|
||||||
|
funnelServiceZipCodeCtu: "11111",
|
||||||
|
};
|
||||||
|
|
||||||
|
//Act
|
||||||
|
mutations.updateYear(storeState, mockStateValues.vehicleYear);
|
||||||
|
mutations.updateMake(storeState, mockStateValues.vehicleMake);
|
||||||
|
mutations.updateModel(storeState, mockStateValues.vehicleModel);
|
||||||
|
mutations.updateStyle(storeState, mockStateValues.vehicleStyle);
|
||||||
|
mutations.updateIsRepair(storeState, mockStateValues.isRepair);
|
||||||
|
mutations.updateNumberOfChips(storeState, mockStateValues.numberOfChips);
|
||||||
|
mutations.updateCarId(storeState, mockStateValues.carId);
|
||||||
|
mutations.updateServiceLocation(storeState, {
|
||||||
|
city: mockStateValues.serviceCity,
|
||||||
|
state: mockStateValues.serviceState,
|
||||||
|
zipCode: mockStateValues.serviceZipCode,
|
||||||
|
zipCodeCtu: mockStateValues.funnelServiceZipCodeCtu,
|
||||||
|
provider: {
|
||||||
|
providerNumber: mockStateValues.funnelProviderNumber,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
|
mutations.updateIsInsurance(storeState, false);
|
||||||
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
|
mutations.updateSupportingItems(storeState, mockStateValues.funnelSupportingItems);
|
||||||
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(getters.experimentOrder(storeState)).toEqual({
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
funnelVehicleYear: mockStateValues.vehicleYear,
|
funnelVehicleYear: mockStateValues.vehicleYear,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue