CSR-1415
Only for windshield replace
This commit is contained in:
parent
418a29a08b
commit
350c96d8e4
2 changed files with 18 additions and 7 deletions
|
|
@ -1531,7 +1531,14 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
||||||
},
|
},
|
||||||
isVinOptionalVehicle(context) {
|
isVinOptionalVehicle(context) {
|
||||||
if (singleWindshieldCarid.find((item) => item === context.state.order.vehicle.carId)) {
|
if (
|
||||||
|
singleWindshieldCarid.find((item) => item === context.state.order.vehicle.carId) &&
|
||||||
|
context.state.order.damage.glassToReplace.find(
|
||||||
|
(glassToReplace) =>
|
||||||
|
glassToReplace.glassLocation.toLowerCase() ===
|
||||||
|
damageLocationsSelected.WINDSHIELD.toLowerCase()
|
||||||
|
)
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2812,19 +2812,23 @@ describe("isVinOptionalVehicle", () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const testcarID = [
|
const testcarID = [
|
||||||
["CR00000100", "make", false],
|
["CR00000100", "make", [{ glassLocation: "driver" }], false],
|
||||||
["CR00067899", "make2", true],
|
["CR00067899", "make2", [{ glassLocation: "windshield" }], true],
|
||||||
["CR00062396", "make3", true],
|
["CR00062396","make3", [{ glassLocation: "windshield" }, { glassLocation: "driver" }], true],
|
||||||
["CR00066428", "make4", false],
|
["CR00066428", "make4", [{ glassLocation: "rear" }], false],
|
||||||
];
|
];
|
||||||
|
|
||||||
test.each(testcarID)(
|
test.each(testcarID)(
|
||||||
"%s %s should skip vin lookup is %s",
|
"%s %s %o should skip vin lookup is %s",
|
||||||
async (carId, make, expectedVinSkip) => {
|
async (carId, make, glassLocation, expectedVinSkip) => {
|
||||||
const context = state;
|
const context = state;
|
||||||
|
|
||||||
context.state = {
|
context.state = {
|
||||||
order: {
|
order: {
|
||||||
vehicle: { make: make, carId: carId },
|
vehicle: { make: make, carId: carId },
|
||||||
|
damage: {
|
||||||
|
glassToReplace: glassLocation,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue