From 3efb2f6e153c0df0a1edd6ffc8c38c7a32f6e3fa Mon Sep 17 00:00:00 2001 From: Kulbhushan Kaushik Date: Mon, 5 Dec 2022 10:35:25 -0500 Subject: [PATCH] COMMIT --- src/layouts/vehicle-parts/vehicle-parts.spec.js | 13 ++++++++++++- src/mixins/vehicle-questions-mixin.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/layouts/vehicle-parts/vehicle-parts.spec.js b/src/layouts/vehicle-parts/vehicle-parts.spec.js index 12292117..4b67fe64 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.spec.js +++ b/src/layouts/vehicle-parts/vehicle-parts.spec.js @@ -23,6 +23,14 @@ jest.mock("@/helpers/cms-content-helper", () => ({ fetchCmsContentForPage: jest.fn(), })); +useMainStore().getters = { + pageData: jest.fn(), + damage: { + isRepair: false, + }, +}; + + const basePartResponse = { partsOrQuestions: [ @@ -69,6 +77,9 @@ describe("vehicle-parts.vue", () => { issPage: "vehicle-parts", }, }, + useMainStore: { + getters: useMainStore().getters, + }, }, }); @@ -110,7 +121,7 @@ describe("vehicle-parts.vue", () => { //Act vehicleParts.beforeRouteEnter.call( wrapper.vm, - { query: { fmgPage: "vehicle-parts" } }, + { query: { issPage: "vehicle-parts" } }, undefined, (c) => c(wrapper.vm) ); diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index dd1b0570..9e482eea 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -405,7 +405,7 @@ export default { // mimic part-questions page data for consistency for (let partOrQuestion of partsOrQuestions) { if (this.hasCapabilityQuestions([partOrQuestion])) { - let capabilityQuestionsForGlassLocation = (await this.mainStore.getCapabilityQuestions(this.mainStore.vehicle.carId, partOrQuestion.parts[0].partNumber)); + let capabilityQuestionsForGlassLocation = (await this.mainStore.getCapabilityQuestions(this.mainStore.vehicle.carId, partOrQuestion.parts[0].partNumber)).data; capabilityQuestionsForGlassLocation.forEach((question) => { question.answers = question.answers.map((answer) => {