Merge pull request #1173 from Safelite/feature/CSR-1415.1
Feature/csr 1415.1
This commit is contained in:
commit
34805e7910
3 changed files with 18940 additions and 2 deletions
18896
src/constants/single-windshield-carids.js
Normal file
18896
src/constants/single-windshield-carids.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -8,6 +8,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { applicationConfig } from "@/constants/application-config";
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
import { experimentTriggers } from "@/constants/experiments";
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
||||||
|
import { singleWindshieldCarIds } from "@/constants/single-windshield-carids";
|
||||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js";
|
import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js";
|
||||||
|
|
@ -1530,6 +1531,19 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
||||||
},
|
},
|
||||||
isVinOptionalVehicle(context) {
|
isVinOptionalVehicle(context) {
|
||||||
|
//Optional for carIds with only a single windshield
|
||||||
|
if (
|
||||||
|
singleWindshieldCarIds.find((item) => item === context.state.order.vehicle.carId) &&
|
||||||
|
context.state.order.damage.glassToReplace.length == 1 &&
|
||||||
|
context.state.order.damage.glassToReplace.find(
|
||||||
|
(glassToReplace) =>
|
||||||
|
glassToReplace.glassLocation.toLowerCase() ===
|
||||||
|
damageLocationsSelected.WINDSHIELD.toLowerCase()
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//Optional for specific YMMSs
|
||||||
switch (context.state.order.vehicle.make.toLowerCase()) {
|
switch (context.state.order.vehicle.make.toLowerCase()) {
|
||||||
case "mercedes benz":
|
case "mercedes benz":
|
||||||
case "volkswagen":
|
case "volkswagen":
|
||||||
|
|
@ -1538,14 +1552,12 @@ export const actions = {
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
context.state.order.vehicle.make.toLowerCase() === "ford" &&
|
context.state.order.vehicle.make.toLowerCase() === "ford" &&
|
||||||
context.state.order.vehicle.year >= 2018
|
context.state.order.vehicle.year >= 2018
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
||||||
context.state.order.vehicle.year <= 2017
|
context.state.order.vehicle.year <= 2017
|
||||||
|
|
|
||||||
|
|
@ -2807,6 +2807,36 @@ describe("isVinOptionalVehicle", () => {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||||
|
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const testcarID = [
|
||||||
|
["CR00000100", "make", [{ glassLocation: "driver" }], false],
|
||||||
|
["CR00067899", "make2", [{ glassLocation: "windshield" }], true],
|
||||||
|
[
|
||||||
|
"CR00062396",
|
||||||
|
"make3",
|
||||||
|
[{ glassLocation: "windshield" }, { glassLocation: "driver" }],
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
["CR00066428", "make4", [{ glassLocation: "rear" }], false],
|
||||||
|
];
|
||||||
|
|
||||||
|
test.each(testcarID)(
|
||||||
|
"%s %s %o should skip vin lookup is %s",
|
||||||
|
async (carId, make, glassLocation, expectedVinSkip) => {
|
||||||
|
const context = state;
|
||||||
|
|
||||||
|
context.state = {
|
||||||
|
order: {
|
||||||
|
vehicle: { make: make, carId: carId },
|
||||||
|
damage: {
|
||||||
|
glassToReplace: glassLocation,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||||
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue