Update vehicle-damage.spec.js
added zip code to get damage options
This commit is contained in:
parent
d4db6c821c
commit
32f11ba277
1 changed files with 12 additions and 8 deletions
|
|
@ -52,6 +52,7 @@ jest.mock("@/store", () => ({
|
|||
damage: {
|
||||
glassToReplace: [],
|
||||
},
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
@ -133,6 +134,7 @@ describe("vehicle-damage.vue", () => {
|
|||
getters: {
|
||||
vehicle: {},
|
||||
payment: { insuranceCoverage: { isVerified: false } },
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -175,7 +177,7 @@ describe("vehicle-damage.vue", () => {
|
|||
expect(wrapper.vm.selectedGlassToReplace()).toEqual(expectedGlassToReplace);
|
||||
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
{ carId: "C00000000" }
|
||||
{ carId: "C00000000", zipCode:"11111" }
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -241,6 +243,7 @@ describe("vehicle-damage.vue", () => {
|
|||
getters: {
|
||||
vehicle: {},
|
||||
payment: { insuranceCoverage: { isVerified: false } },
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -270,11 +273,10 @@ describe("vehicle-damage.vue", () => {
|
|||
expect(wrapper.vm.selectedGlassToReplace()).toEqual(expectedGlassToReplace);
|
||||
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
{ carId: "C00000000" }
|
||||
{ carId: "C00000000", zipCode:"11111" }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("alert", () => {
|
||||
test("when displayVehicleChangeAlert router params is true, the alert: 'vehicleChangeAlert' should be rendered", () => {
|
||||
// Arrange & Act
|
||||
|
|
@ -321,7 +323,6 @@ describe("vehicle-damage.vue", () => {
|
|||
expect(wrapper.findComponent({ ref: "vehicleChangeAlert" }).exists()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("glass selections and corresponding variables", () => {
|
||||
test("isWindshieldDamageLocation is true when windshield is selected", async () => {
|
||||
//Arrange
|
||||
|
|
@ -453,7 +454,6 @@ describe("vehicle-damage.vue", () => {
|
|||
expect(wrapper.vm.isPassengerSideReplace).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("state validations", () => {
|
||||
test("CarId set, arePagePrerequisitesValid should be true ", async () => {
|
||||
//Arrange
|
||||
|
|
@ -474,7 +474,6 @@ describe("vehicle-damage.vue", () => {
|
|||
expect(arePagePrerequisitesValid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("input validations", () => {
|
||||
// THE FOLLOWING TEST IS NOT NECESSARILY REQUIRED FOR COVERAGE
|
||||
// BUT KEEP FOR AN EXAMPLE OF A VALIDATION TEST
|
||||
|
|
@ -501,7 +500,6 @@ describe("vehicle-damage.vue", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("get glass options from store", () => {
|
||||
const damageLocations = [
|
||||
["Windshield", [damageLocationsSelected.WINDSHIELD]],
|
||||
|
|
@ -528,6 +526,7 @@ describe("vehicle-damage.vue", () => {
|
|||
eventBusItem: jest.fn(),
|
||||
damage: { glassToReplace: [{ glassLocation: damageLocation }] },
|
||||
isRepair: true,
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
};
|
||||
|
||||
var glassSelections = wrapper.vm.getDamageLocationsFromStore();
|
||||
|
|
@ -605,6 +604,7 @@ describe("vehicle-damage.vue", () => {
|
|||
isRepair: isRepair,
|
||||
numberOfChips: 2,
|
||||
},
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
};
|
||||
|
||||
var windshieldSelections = wrapper.vm.getWindshieldOptionsFromStore();
|
||||
|
|
@ -641,6 +641,7 @@ describe("vehicle-damage.vue", () => {
|
|||
glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }],
|
||||
},
|
||||
isRepair: true,
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
};
|
||||
|
||||
var glassSelections = wrapper.vm.getDriverSideReplaceOptionsFromStore();
|
||||
|
|
@ -677,6 +678,7 @@ describe("vehicle-damage.vue", () => {
|
|||
glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }],
|
||||
},
|
||||
isRepair: true,
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
};
|
||||
|
||||
var glassSelections = wrapper.vm.getPassengerSideReplaceOptionsFromStore();
|
||||
|
|
@ -711,6 +713,7 @@ describe("vehicle-damage.vue", () => {
|
|||
glassToReplace: [{ glassLocation: damageLocation, glassName: damageName }],
|
||||
},
|
||||
isRepair: true,
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
};
|
||||
|
||||
var glassSelections = wrapper.vm.getRearReplaceOptionsFromStore();
|
||||
|
|
@ -720,7 +723,6 @@ describe("vehicle-damage.vue", () => {
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe("hide back button", () => {
|
||||
test("if claim registration is delayed => should hide back button", () => {
|
||||
// Arrange
|
||||
|
|
@ -744,6 +746,7 @@ describe("vehicle-damage.vue", () => {
|
|||
getters: {
|
||||
vehicle: {},
|
||||
payment: { insuranceCoverage: { isVerified: true } },
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -784,6 +787,7 @@ function setupMocks({ pageHeaderWidgetHeaderText, mountOptionsMockData, funnelCo
|
|||
isVerified: false,
|
||||
},
|
||||
},
|
||||
order: {serviceLocation: {zipCode: "11111",},},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue