CSR-889 | Resolving unit test failures
This commit is contained in:
parent
ee74065ab1
commit
701e337b9b
3 changed files with 18 additions and 28 deletions
|
|
@ -49,14 +49,14 @@ describe("service-package-question.vue", () => {
|
||||||
const packageNameKey = "05_01_CSR_Quote_Standard_Repair";
|
const packageNameKey = "05_01_CSR_Quote_Standard_Repair";
|
||||||
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
|
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
|
||||||
});
|
});
|
||||||
it("should emit captured value", () => {
|
it("should emit relevant VAPS items in an array", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const wrapper = setupMocks({});
|
const wrapper = setupMocks({});
|
||||||
// Act
|
// Act
|
||||||
wrapper.componentVM.selectedValues = "newValue";
|
wrapper.componentVM.selectedValues = "TierThree";
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual("newValue");
|
expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual([{"description": null, "partNumber": "RAIN DEFENSE", "partType": "RAIN DEFENSE", "price": 35.5}]);
|
||||||
});
|
});
|
||||||
it("should have the correct insurance pricing text when insurance is selected", () => {
|
it("should have the correct insurance pricing text when insurance is selected", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,11 @@ export const getters = {
|
||||||
"partNumber"
|
"partNumber"
|
||||||
),
|
),
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
state.order.lineItems.otherParts,
|
state.order.lineItems.supportingItems,
|
||||||
|
"partNumber"
|
||||||
|
),
|
||||||
|
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||||
|
state.order.lineItems.vaps,
|
||||||
"partNumber"
|
"partNumber"
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -461,10 +465,6 @@ export const getters = {
|
||||||
state.order.lineItems.glassParts,
|
state.order.lineItems.glassParts,
|
||||||
"recalibrationType"
|
"recalibrationType"
|
||||||
),
|
),
|
||||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
|
||||||
state.order.lineItems.otherParts,
|
|
||||||
"recalibrationType"
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -476,21 +476,6 @@ describe("Actions", () => {
|
||||||
expect(response.data).toEqual("43201");
|
expect(response.data).toEqual("43201");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resetVehicleAndDependencies action", async () => {
|
|
||||||
// Arrange
|
|
||||||
const context = state;
|
|
||||||
const commit = jest.fn();
|
|
||||||
|
|
||||||
context.commit = commit;
|
|
||||||
|
|
||||||
// Act
|
|
||||||
await actions.resetVehicleAndDependencies(context);
|
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_VEHICLE_STATE);
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_DAMAGE_STATE);
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_REGISTRATION_STATE);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("resetDamageAndDependencies action", async () => {
|
it("resetDamageAndDependencies action", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = state;
|
||||||
|
|
@ -2409,7 +2394,8 @@ describe("Getters", () => {
|
||||||
funnelParentAccountNumber: "999999",
|
funnelParentAccountNumber: "999999",
|
||||||
funnelIsCoverageVerified: true,
|
funnelIsCoverageVerified: true,
|
||||||
funnelGlassParts: null,
|
funnelGlassParts: null,
|
||||||
funnelOtherParts: null,
|
funnelSupportingItems: null,
|
||||||
|
funnelVaps: null,
|
||||||
funnelGlassToReplace: null,
|
funnelGlassToReplace: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2432,7 +2418,8 @@ describe("Getters", () => {
|
||||||
mockStateValues.funnelIsCoverageVerified
|
mockStateValues.funnelIsCoverageVerified
|
||||||
);
|
);
|
||||||
mutations.updateGlassParts(storeState, mockStateValues.funnelGlassParts);
|
mutations.updateGlassParts(storeState, mockStateValues.funnelGlassParts);
|
||||||
mutations.updateOtherParts(storeState, mockStateValues.funnelOtherParts);
|
mutations.updateSupportingItems(storeState, mockStateValues.funnelSupportingItems);
|
||||||
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
mutations.updateGlassToReplace(storeState, mockStateValues.funnelGlassToReplace);
|
mutations.updateGlassToReplace(storeState, mockStateValues.funnelGlassToReplace);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
|
|
@ -2500,7 +2487,8 @@ describe("Getters", () => {
|
||||||
mockStateValues.funnelIsCoverageVerified
|
mockStateValues.funnelIsCoverageVerified
|
||||||
);
|
);
|
||||||
mutations.updateGlassParts(storeState, mockStateValues.funnelGlassParts);
|
mutations.updateGlassParts(storeState, mockStateValues.funnelGlassParts);
|
||||||
mutations.updateOtherParts(storeState, mockStateValues.funnelOtherParts);
|
mutations.updateSupportingItems(storeState, mockStateValues.funnelSupportingItems);
|
||||||
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
mutations.updateGlassToReplace(storeState, mockStateValues.funnelGlassToReplace);
|
mutations.updateGlassToReplace(storeState, mockStateValues.funnelGlassToReplace);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
|
|
@ -2578,7 +2566,8 @@ describe("Getters", () => {
|
||||||
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
mutations.updateSupportingItems(storeState, mockStateValues.funnelSupportingItems);
|
||||||
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
|
|
@ -2682,7 +2671,8 @@ describe("Getters", () => {
|
||||||
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
mutations.updateSupportingItems(storeState, mockStateValues.funnelSupportingItems);
|
||||||
|
mutations.updateVaps(storeState, mockStateValues.funnelVaps);
|
||||||
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue