CSR-889 | Resolving unit test failures

This commit is contained in:
Scott Kiener 2022-11-29 09:55:02 -05:00
parent ee74065ab1
commit 701e337b9b
3 changed files with 18 additions and 28 deletions

View file

@ -49,14 +49,14 @@ describe("service-package-question.vue", () => {
const packageNameKey = "05_01_CSR_Quote_Standard_Repair";
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
});
it("should emit captured value", () => {
it("should emit relevant VAPS items in an array", () => {
// Arrange
const wrapper = setupMocks({});
// Act
wrapper.componentVM.selectedValues = "newValue";
wrapper.componentVM.selectedValues = "TierThree";
// 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", () => {
// Arrange

View file

@ -451,7 +451,11 @@ export const getters = {
"partNumber"
),
...getNonFalseValuesOfPropertyInArrayOfObjects(
state.order.lineItems.otherParts,
state.order.lineItems.supportingItems,
"partNumber"
),
...getNonFalseValuesOfPropertyInArrayOfObjects(
state.order.lineItems.vaps,
"partNumber"
),
],
@ -461,10 +465,6 @@ export const getters = {
state.order.lineItems.glassParts,
"recalibrationType"
),
...getNonFalseValuesOfPropertyInArrayOfObjects(
state.order.lineItems.otherParts,
"recalibrationType"
),
],
};
},

View file

@ -476,21 +476,6 @@ describe("Actions", () => {
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 () => {
// Arrange
const context = state;
@ -2409,7 +2394,8 @@ describe("Getters", () => {
funnelParentAccountNumber: "999999",
funnelIsCoverageVerified: true,
funnelGlassParts: null,
funnelOtherParts: null,
funnelSupportingItems: null,
funnelVaps: null,
funnelGlassToReplace: null,
};
@ -2432,7 +2418,8 @@ describe("Getters", () => {
mockStateValues.funnelIsCoverageVerified
);
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);
//Assert
@ -2500,7 +2487,8 @@ describe("Getters", () => {
mockStateValues.funnelIsCoverageVerified
);
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);
//Assert
@ -2578,7 +2566,8 @@ describe("Getters", () => {
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
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);
//Assert
@ -2682,7 +2671,8 @@ describe("Getters", () => {
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
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);
//Assert