This commit is contained in:
Kulbhushan Kaushik 2022-12-05 10:35:25 -05:00
parent 17a736b542
commit 3efb2f6e15
2 changed files with 13 additions and 2 deletions

View file

@ -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)
);

View file

@ -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) => {