diff --git a/src/helpers/damage-helper.js b/src/helpers/damage-helper.js index 55d10738d..ed353e51b 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]?.location) { + switch(damageLocations[0]?.glassLocation) { 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]?.location === "Windshield" ? "windshield" : "glass"; + const returnString = damageLocations.length === 1 && damageLocations[0]?.glassLocation === "Windshield" ? "windshield" : "glass"; return returnString; } @@ -56,7 +56,7 @@ export async function isGlassAvailableForCarId(carId){ } for(const option of currentGlassOptions){ - if(!newGlassOptions.data[optionsMap[option.location]].availableReplacementOptions.includes(option.name)){ + if(!newGlassOptions.data[optionsMap[option.glassLocation]].availableReplacementOptions.includes(option.glassName)){ return false; } } diff --git a/src/helpers/damage-helper.spec.js b/src/helpers/damage-helper.spec.js index 2a46978dc..210bf96cc 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 = [{location: "Windshield", name: "windshield"}, {location: "Passenger", name: "sideWindow"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "windshield"}, {glassLocation: "Passenger", glassName: "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 = [{location: "Windshield", name: "windshield"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "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 = [{location: "Passenger", name: "sideWindow"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Passenger", glassName: "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 = [{location: "Rear", name: "rear"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Rear", glassName: "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 = [{location: "Windshield", name: "windshield"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "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 = [{location: "Windshield", name: "sideWindow"}]; + store.getters.damage.glassToReplace = [{glassLocation: "Windshield", glassName: "sideWindow"}]; const isGlassAvailable = await isGlassAvailableForCarId(); diff --git a/src/layouts/capability-questions/capability-questions.vue b/src/layouts/capability-questions/capability-questions.vue index 6491a76df..187f02fe1 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" />