diff --git a/jest.config.js b/jest.config.js index ded486df9..80b382c5a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -28,7 +28,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 85, + statements: 83, // Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90 }, }, diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index ed353e51b..55d10738d 100644 --- a/src/helpers/damage-helper.js +++ b/src/helpers/damage-helper.js @@ -19,7 +19,7 @@ export function getDamageString() { if (damageLocations.length > 1) { returnString = "match" } else { - switch(damageLocations[0]?.glassLocation) { + switch(damageLocations[0]?.location) { case "Windshield": returnString = "windshield" break; @@ -36,7 +36,7 @@ export function getDamageString() { export function getIsWindshieldOnly () { const damageLocations = store.getters.damage.glassToReplace; - const returnString = damageLocations.length === 1 && damageLocations[0]?.glassLocation === "Windshield" ? "windshield" : "glass"; + const returnString = damageLocations.length === 1 && damageLocations[0]?.location === "Windshield" ? "windshield" : "glass"; return returnString; } @@ -56,7 +56,7 @@ export async function isGlassAvailableForCarId(carId){ } for(const option of currentGlassOptions){ - if(!newGlassOptions.data[optionsMap[option.glassLocation]].availableReplacementOptions.includes(option.glassName)){ + if(!newGlassOptions.data[optionsMap[option.location]].availableReplacementOptions.includes(option.name)){ return false; } } diff --git a/src/helpers/damage-helper.spec.js b/src/helpers/damage-helper.spec.js index 210bf96cc..2a46978dc 100644 --- a/src/helpers/damage-helper.spec.js +++ b/src/helpers/damage-helper.spec.js @@ -16,7 +16,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ it("Should return match when multiple selected damage options are in the store", () => { // Arrange / Act - store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}, {glassLocation: "Passenger", glassName: "sideWindow"}]; + store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}, {location: "Passenger", name: "sideWindow"}]; const damage = getDamageString(); @@ -29,7 +29,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ it("Should return windshield when Windshield is the only selected damage option in the store", () => { // Arrange / Act - store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}]; + store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}]; const damage = getDamageString(); @@ -42,7 +42,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ it("Should return side window when Driver or Passenger is the only selected damage option in the store", () => { // Arrange / Act - store.getters.damage.glassToReplace = [{glassLocation: "Passenger", glassName: "sideWindow"}]; + store.getters.damage.glassToReplace = [{location: "Passenger", name: "sideWindow"}]; const damage = getDamageString(); @@ -55,7 +55,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ it("Should return rear window when Rear is the only selected damage option in the store", () => { // Arrange / Act - store.getters.damage.glassToReplace = [{glassLocation: "Rear", glassName: "rear"}]; + store.getters.damage.glassToReplace = [{location: "Rear", name: "rear"}]; const damage = getDamageString(); @@ -67,7 +67,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ describe("damage-helper.js", () => { it("Should return true if no mismatches between each array exist", async () => { // Arrange - store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}]; + store.getters.damage.glassToReplace = [{location: "Windshield", name: "windshield"}]; // Act const isGlassAvailable = await isGlassAvailableForCarId(); @@ -80,7 +80,7 @@ jest.mock("@/mixins/base-mixin.js", () => ({ describe("damage-helper.js", () => { it("Should return false if any mismatches between each array exist", async () => { // Arrange - store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "sideWindow"}]; + store.getters.damage.glassToReplace = [{location: "Windshield", name: "sideWindow"}]; const isGlassAvailable = await isGlassAvailableForCarId(); diff --git a/src/layouts/capability-questions/capability-questions.vue b/src/layouts/capability-questions/capability-questions.vue index 39b96c361..6491a76df 100644 --- a/src/layouts/capability-questions/capability-questions.vue +++ b/src/layouts/capability-questions/capability-questions.vue @@ -11,7 +11,7 @@ v-bind:isDismissible="false" />