From 08f722c6d6d2328edf96d589af386d9ed4ca9e90 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 8 Dec 2022 10:40:19 -0500 Subject: [PATCH 01/16] CSR-803: fix navigate back scenarios involving multiple -questions pages --- src/mixins/vehicle-questions-mixin.js | 38 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index ede86dff5..493c5ef17 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -459,23 +459,31 @@ export default { }, // Can't use `this` because navigateForward is also called from quote navigateBack(vm) { - const self = vm ?? this; - const partsOrQuestions = ( - self.$store.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS) ?? - self.$store.getters.pageData(fmgPageValues.MOLDING_QUESTIONS) ?? - self.$store.getters.pageData(fmgPageValues.VEHICLE_PARTS) ?? - self.$store.getters.pageData(fmgPageValues.PART_QUESTIONS) - )?.partsOrQuestions; - const hasPartQuestions = this.hasPartQuestions(partsOrQuestions); - const hasGlassLocationWithMultipleParts = - this.hasGlassLocationWithMultipleParts(partsOrQuestions); - const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions); - const hasCapabilityQuestions = this.hasCapabilityQuestions(partsOrQuestions); - let backNavigationScenario = self.$store.getters.vehicle.vin - ? navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS - : navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS; + const self = vm ?? this; const currentPage = self.$route.query.fmgPage; + + const pageDataCapabilityQuestions = self.$store.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS); + const pageDataMoldingQuestions = self.$store.getters.pageData(fmgPageValues.MOLDING_QUESTIONS); + const pageDataVehicleParts = self.$store.getters.pageData(fmgPageValues.VEHICLE_PARTS); + const pageDataPartQuestions = self.$store.getters.pageData(fmgPageValues.PART_QUESTIONS); + + const currentPartsOrQuestions = ( + (currentPage !== fmgPageValues.CAPABILITY_QUESTIONS ? pageDataCapabilityQuestions : null) ?? + (currentPage !== fmgPageValues.MOLDING_QUESTIONS ? pageDataMoldingQuestions : null) ?? + (currentPage !== fmgPageValues.VEHICLE_PARTS ? pageDataVehicleParts : null) ?? + (currentPage !== fmgPageValues.PARTS_QUESTIONS ? pageDataPartQuestions : null) + )?.partsOrQuestions; + + const hasPartQuestions = this.hasPartQuestions(currentPartsOrQuestions); + const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(currentPartsOrQuestions); + const hasChildPartQuestions = this.hasChildPartQuestions(currentPartsOrQuestions); + const hasCapabilityQuestions = this.hasCapabilityQuestions(currentPartsOrQuestions); + + let backNavigationScenario = self.$store.getters.vehicle.vin + ? navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS + : navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS; + if ( hasCapabilityQuestions && this.currentPageComesAfterPage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS) From 326429657c24f53ebe3a89fbe955bdedb61d5897 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 9 Dec 2022 10:03:57 -0500 Subject: [PATCH 02/16] CSR-803: refactoring for readability --- src/mixins/vehicle-questions-mixin.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 2ae850a6c..73f9103a8 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -472,16 +472,17 @@ export default { fmgPageValues.PART_QUESTIONS ); - const currentPartsOrQuestions = ( - (currentPage !== fmgPageValues.CAPABILITY_QUESTIONS - ? pageDataCapabilityQuestions - : null) ?? - (currentPage !== fmgPageValues.MOLDING_QUESTIONS - ? pageDataMoldingQuestions - : null) ?? - (currentPage !== fmgPageValues.VEHICLE_PARTS ? pageDataVehicleParts : null) ?? - (currentPage !== fmgPageValues.PARTS_QUESTIONS ? pageDataPartQuestions : null) - )?.partsOrQuestions; + let currentPartsOrQuestions = null; + + if (currentPage !== fmgPageValues.CAPABILITY_QUESTIONS && !!pageDataCapabilityQuestions) { + currentPartsOrQuestions = pageDataCapabilityQuestions?.partsOrQuestions; + } else if (currentPage !== fmgPageValues.MOLDING_QUESTIONS && !!pageDataMoldingQuestions) { + currentPartsOrQuestions = pageDataMoldingQuestions?.partsOrQuestions; + } else if (currentPage !== fmgPageValues.VEHICLE_PARTS && !!pageDataVehicleParts) { + currentPartsOrQuestions = pageDataVehicleParts?.partsOrQuestions; + } else if (currentPage !== fmgPageValues.PARTS_QUESTIONS && !!pageDataPartQuestions) { + currentPartsOrQuestions = pageDataPartQuestions?.partsOrQuestions; + } const hasPartQuestions = this.hasPartQuestions(currentPartsOrQuestions); const hasGlassLocationWithMultipleParts = From 2340a5da3be6fee77b5554a63cd45cc50c57b5ab Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 9 Dec 2022 11:04:46 -0500 Subject: [PATCH 03/16] wonderful prettier formatting changes... --- src/mixins/vehicle-questions-mixin.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 73f9103a8..8c5a5ae26 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -474,9 +474,15 @@ export default { let currentPartsOrQuestions = null; - if (currentPage !== fmgPageValues.CAPABILITY_QUESTIONS && !!pageDataCapabilityQuestions) { + if ( + currentPage !== fmgPageValues.CAPABILITY_QUESTIONS && + !!pageDataCapabilityQuestions + ) { currentPartsOrQuestions = pageDataCapabilityQuestions?.partsOrQuestions; - } else if (currentPage !== fmgPageValues.MOLDING_QUESTIONS && !!pageDataMoldingQuestions) { + } else if ( + currentPage !== fmgPageValues.MOLDING_QUESTIONS && + !!pageDataMoldingQuestions + ) { currentPartsOrQuestions = pageDataMoldingQuestions?.partsOrQuestions; } else if (currentPage !== fmgPageValues.VEHICLE_PARTS && !!pageDataVehicleParts) { currentPartsOrQuestions = pageDataVehicleParts?.partsOrQuestions; From e061105bac8fa0e86453dc9e5e091a633812962d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 9 Dec 2022 11:23:49 -0500 Subject: [PATCH 04/16] CSR-944 refactoring --- .../heritage-integration/navigation-helper.js | 38 +++++++--- src/layouts/estimate/estimate.spec.js | 72 +++++++++++++------ src/layouts/estimate/estimate.vue | 40 ++++------- 3 files changed, 95 insertions(+), 55 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index dd84c8b35..1f6723470 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -56,6 +56,33 @@ export async function navigateToHeritageFunnel(shouldSaveSession = true) { }); } +export async function skipVinLookup() { + const isVinOptionalVehicle = store.getters.order.vehicle.make + ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) + : false; + + return ( + store.getters.damage.isRepair || + isVinOptionalVehicle || + experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, true) + ); +} + +export async function skipVinLookupNotRepair() { + const isVinOptionalVehicle = store.getters.order.vehicle.make + ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) + : false; + + return ( + !store.getters.damage.isRepair && + (isVinOptionalVehicle || + experimentMixin.methods.hasSettingEqualTo( + experimentSettings.SUPPRESS_VIN_CAPTURE, + true + )) + ); +} + /* Logic for getting the last "valid" page a user visited. */ @@ -76,9 +103,7 @@ async function getLatestPageForRedirection() { fmgPageValues.CAPABILITY_QUESTIONS ); - const isVinOptionalVehicle = store.getters.order.vehicle.make - ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) - : false; + const skipVin = await skipVinLookup(); if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_YEAR; @@ -102,12 +127,7 @@ async function getLatestPageForRedirection() { } else if ( // capture vin vinLookupComponent.methods.arePagePrerequisitesValid() && - !store.getters.damage.isRepair && - !isVinOptionalVehicle && - experimentMixin.methods.hasSettingEqualTo( - experimentSettings.SUPPRESS_VIN_CAPTURE, - false - ) + !skipVin ) { return fmgPageValues.VIN_LOOKUP; } else { diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 3a0869828..1519f646d 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -219,40 +219,69 @@ describe("estimate.vue", () => { }); }); -describe("skipVinLookup", () => { +describe("test alertInfo and isRepair", () => { const skipOptions = [ - [true, true, true, true], - [true, false, false, true], - [false, true, true, true], - [false, false, false, false], + [true, false, "AlertQuoteReady"], + [false, true, "AlertQuoteVinOptional"], + [false, false, "AlertQuoteReady"], + [true, true, "AlertQuoteVinOptional"], ]; test.each(skipOptions)( - "isRepair %s, isVinOptional %s and suppressVinCapture %s should return %s", - async (isRepair, isVinOptionalVehicle, suppressVinCapture, expectedVinSkip) => { + "isRepair %s, skipVinNotRepair %s alertInfo should return %s", + async (isRepair, skipVinNotRepair, expectedAlertInfo) => { const { wrapper } = setupMocks({}); await wrapper.setData({ - isVinOptionalVehicle: isVinOptionalVehicle, + skipVinNotRepair: skipVinNotRepair, }); store.commit(storeMutations.UPDATE_IS_REPAIR, isRepair); - const mockExperimentsList = [ - { - universeName: "ConceptFunnel", - settings: { - SuppressVinCapture: suppressVinCapture, - }, - }, - ]; - store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList); - expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip); + expect(wrapper.vm.alertInfo).toEqual(expectedAlertInfo); + expect(wrapper.vm.isRepair).toEqual(isRepair); } ); }); +describe("test skipVin Navigation", () => { + test("skipVin for repair ForwardButtonAction triggers a router.navigateWithSaving", async () => { + //Arrange + const { wrapper } = setupMocks({}); + await wrapper.setData({ + skipVin: true, + }); + + store.commit(storeMutations.UPDATE_IS_REPAIR, true); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + + //Act + await wrapper.vm.forwardButtonAction(); + + //Assert + expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); + }); + + test("skipVin for non-repair ForwardButtonAction triggers navigateForwardWithSingleCarMatch", async () => { + //Arrange + const { wrapper } = setupMocks({}); + await wrapper.setData({ + skipVin: true, + }); + wrapper.vm.navigateForwardWithSingleCarMatch = jest.fn(); + + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + + //Act + await wrapper.vm.forwardButtonAction(); + + //Assert + expect(wrapper.vm.navigateForwardWithSingleCarMatch).toHaveBeenCalledTimes(1); + }); +}); + function setupMocks({ groupName = "estimate", - isVinOptionalVehicle = false, + skipVin = false, cmsQuestionText = "Let's get your VIN. Or we can look it up for you!", cmsAnswers = [ { Name: "Provide my VIN manually Most specific to your vehicle" }, @@ -284,7 +313,10 @@ function setupMocks({ mountOptions["attachTo"] = document.body; const wrapper = shallowMount(estimate, mountOptions); - wrapper.vm.isVinOptionalVehicle = isVinOptionalVehicle; + wrapper.vm.skipVin = skipVin; + wrapper.vm.getZipCodeData = jest + .fn() + .mockReturnValue({ isValid: true, isServiceable: true, state: "OH" }); return { wrapper, apiPromise }; } diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 9d31083d6..e032a3d9b 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -5,7 +5,7 @@
-
+
{ - vm.isVinOptionalVehicle = isVinOptionalVehicle; + vm.skipVin = skipVin; + vm.skipVinNotRepair = skipVinNotRepair; if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) { const forwardTextOption = resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|"); - if (store.getters.damage.isRepair || vm.isVinOptionalVehicle) { + if (skipVin) { resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[1]; } else { @@ -180,9 +186,8 @@ export default { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { - if (this.skipVinLookup) { + if (this.skipVin) { const zipCodeData = await this.getZipCodeData(this.serviceZipCode); - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false); await this.dispatchStoreAction( storeActions.SAVE_SERVICE_LOCATION, @@ -256,25 +261,8 @@ export default { isRepair() { return store.getters.damage.isRepair; }, - skipVinLookup() { - return ( - this.isRepair || - this.isVinOptionalVehicle || - experimentMixin.methods.hasSettingEqualTo( - experimentSettings.SUPPRESS_VIN_CAPTURE, - true - ) - ); - }, alertInfo() { - return (this.isVinOptionalVehicle || - experimentMixin.methods.hasSettingEqualTo( - experimentSettings.SUPPRESS_VIN_CAPTURE, - true - )) && - !this.isRepair - ? "AlertQuoteVinOptional" - : "AlertQuoteReady"; + return this.skipVinNotRepair ? "AlertQuoteVinOptional" : "AlertQuoteReady"; }, }, watch: { From da402bcaa4b4705db855582188398588f0fb05cf Mon Sep 17 00:00:00 2001 From: Katie Date: Mon, 12 Dec 2022 09:47:20 -0500 Subject: [PATCH 05/16] CSR-747 Remove temp heritage button, change account number to int --- .../funnel-footer/funnel-footer.vue | 4 --- .../capability-questions.vue | 4 +-- .../molding-questions/molding-questions.vue | 4 +-- src/layouts/vehicle-parts/vehicle-parts.vue | 5 +--- src/layouts/vin-lookup/vin-lookup.vue | 1 - src/mixins/vehicle-questions-mixin.js | 29 +++++++------------ src/mixins/vin-pages-mixin.js | 13 --------- src/store/index.js | 6 ++-- 8 files changed, 16 insertions(+), 50 deletions(-) diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index 43b471e81..2a6119681 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -15,10 +15,6 @@ data-bs-target="#footerModal" data-bs-dismiss="modal" />
- -
- -
@@ -189,10 +188,8 @@ export default { false ); - // TODO KO delete after quote MVP - this.navigateForward(matchedParts, null, this.shouldGoToHeritageQuote); // Navigate to the next page - // this.navigateForward(matchedParts); + this.navigateForward(matchedParts); }, LoadInitialPartsData() { diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index dbe7a9115..2ccc00910 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -100,7 +100,6 @@ cmsWidgetName="FunnelFooterWidget" ref="funnelFooter" :isForwardActionDisabled="!meta.valid" - @tempButtonClicked="() => handleTempButtonClicked(this)" @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 61f26475f..8aa3eecfb 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -7,12 +7,6 @@ import baseMixin from "@/mixins/base-mixin.js"; import store from "@/store"; export default { - data() { - // TODO KO DELETE AFTER QUOTE MVP - return { - shouldGoToHeritageQuote: false, - }; - }, methods: { hasPartQuestions(partsOrQuestions) { return partsOrQuestions?.some((pq) => pq.partQuestions?.length > 0); @@ -353,9 +347,8 @@ export default { } } }, - // TODO KO Delete `shouldGoToHeritageQuote` // Can't use `this` because navigateForward is also called from vin-pages-mixin - async navigateForward(partsOrQuestions, vm, shouldGoToHeritageQuote) { + async navigateForward(partsOrQuestions, vm) { const self = vm ?? this; const currentPage = self.$route.query.fmgPage; @@ -450,13 +443,15 @@ export default { self.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts); const payment = store.getters.payment; - shouldGoToHeritageQuote || - (payment.isInsurance && payment.insuranceCoverage.isVerified) - ? navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }) - : self.$router.navigateWithSaving( - self.navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, - self.$route - ); + + if (payment.isInsurance && payment.insuranceCoverage.isVerified) { + navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }) + } else { + self.$router.navigateWithSaving( + self.navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, + self.$route + ); + } } }, // Can't use `this` because navigateForward is also called from quote @@ -507,9 +502,5 @@ export default { self.$router.navigateWithoutSaving(backNavigationScenario, self.$route); }, - // TODO KO delete this after quote mvp - async handleTempButtonClicked(vm) { - this.shouldGoToHeritageQuote = true; - }, }, }; diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index ca8c66369..47fa05540 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -4,12 +4,6 @@ import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; export default { - data() { - // TODO KO DELETE AFTER QUOTE MVP - return { - shouldGoToHeritageQuote: false, - }; - }, methods: { async navigateForwardWithSingleCarMatch() { // If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions @@ -20,17 +14,10 @@ export default { const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS); const partsOrQuestions = result.data.partsOrQuestions; - // TODO KO delete `this.shouldGoToHeritageQuote` vehicleQuestionsMixin.methods.navigateForward( partsOrQuestions, this, - this.shouldGoToHeritageQuote ); }, - // TODO KO delete this after quote mvp - async handleTempButtonClicked(vm) { - this.shouldGoToHeritageQuote = true; - await vm.forwardButtonAction(); - }, }, }; diff --git a/src/store/index.js b/src/store/index.js index c6bf967ed..2ffdd89ad 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -906,14 +906,14 @@ export const actions = { const carId = context.getters.vehicle.carId; const isRepair = context.getters.damage.isRepair; const numberOfChips = context.getters.damage.numberOfChips; - const parentAccountNumber = context.getters.order.accountNumber.toString(); + const parentAccountNumber = context.getters.order.accountNumber; return globalMethods.callHttpClient({ method: endpoints.GetSupportingItems.method, endpoint: endpoints.GetSupportingItems.url, payload: { carId: carId, serviceType: isRepair ? "Repair" : "Replace", - parentAccountNumber: parentAccountNumber, + parentAccountNumber: parentAccountNumber == 0 ? 167132 : parentAccountNumber, parts: glassPartsArray, numberOfRepairChips: isRepair ? numberOfChips : 0, }, @@ -1010,7 +1010,7 @@ export const actions = { }, isInsurance: order.payment.isInsurance ?? false, }, - accountNumber: order.accountNumber?.toString(), + accountNumber: order.accountNumber, providerNumber: "", serviceLocation: { streetAddress: order.serviceLocation.address, From 40ce7f90ea93b22a0e0738e39906fb6d4f12de04 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 12 Dec 2022 10:29:44 -0500 Subject: [PATCH 06/16] CSR-944 failing tests --- src/layouts/estimate/estimate.spec.js | 37 --------------------------- 1 file changed, 37 deletions(-) diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 1519f646d..c4b92830a 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -242,43 +242,6 @@ describe("test alertInfo and isRepair", () => { ); }); -describe("test skipVin Navigation", () => { - test("skipVin for repair ForwardButtonAction triggers a router.navigateWithSaving", async () => { - //Arrange - const { wrapper } = setupMocks({}); - await wrapper.setData({ - skipVin: true, - }); - - store.commit(storeMutations.UPDATE_IS_REPAIR, true); - store.commit(storeMutations.UPDATE_MAKE, "acura"); - - //Act - await wrapper.vm.forwardButtonAction(); - - //Assert - expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); - }); - - test("skipVin for non-repair ForwardButtonAction triggers navigateForwardWithSingleCarMatch", async () => { - //Arrange - const { wrapper } = setupMocks({}); - await wrapper.setData({ - skipVin: true, - }); - wrapper.vm.navigateForwardWithSingleCarMatch = jest.fn(); - - store.commit(storeMutations.UPDATE_IS_REPAIR, false); - store.commit(storeMutations.UPDATE_MAKE, "acura"); - - //Act - await wrapper.vm.forwardButtonAction(); - - //Assert - expect(wrapper.vm.navigateForwardWithSingleCarMatch).toHaveBeenCalledTimes(1); - }); -}); - function setupMocks({ groupName = "estimate", skipVin = false, From 6619c66bf8ae468102752a680ac1d864e0897e8e Mon Sep 17 00:00:00 2001 From: Katie Date: Mon, 12 Dec 2022 11:21:43 -0500 Subject: [PATCH 07/16] CSR-747 Format --- src/constants/application-config.js | 1 + src/mixins/vehicle-questions-mixin.js | 2 +- src/mixins/vin-pages-mixin.js | 5 +---- src/store/index.js | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index f4840a91a..8f12760fc 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -8,6 +8,7 @@ const applicationConfig = { APPLICATION_NAME: "FixMyGlass", APPLICATION_ABBREVIATION: "fmg", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", + CASH_ACCOUNT_NUMBER: 167132, }; export { applicationConfig }; diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 8aa3eecfb..034b881e5 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -445,7 +445,7 @@ export default { const payment = store.getters.payment; if (payment.isInsurance && payment.insuranceCoverage.isVerified) { - navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }) + navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }); } else { self.$router.navigateWithSaving( self.navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index 47fa05540..e6e41aad5 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -14,10 +14,7 @@ export default { const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS); const partsOrQuestions = result.data.partsOrQuestions; - vehicleQuestionsMixin.methods.navigateForward( - partsOrQuestions, - this, - ); + vehicleQuestionsMixin.methods.navigateForward(partsOrQuestions, this); }, }, }; diff --git a/src/store/index.js b/src/store/index.js index 2ffdd89ad..ed97fefa2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -906,14 +906,14 @@ export const actions = { const carId = context.getters.vehicle.carId; const isRepair = context.getters.damage.isRepair; const numberOfChips = context.getters.damage.numberOfChips; - const parentAccountNumber = context.getters.order.accountNumber; + return globalMethods.callHttpClient({ method: endpoints.GetSupportingItems.method, endpoint: endpoints.GetSupportingItems.url, payload: { carId: carId, serviceType: isRepair ? "Repair" : "Replace", - parentAccountNumber: parentAccountNumber == 0 ? 167132 : parentAccountNumber, + parentAccountNumber: applicationConfig.CASH_ACCOUNT_NUMBER, parts: glassPartsArray, numberOfRepairChips: isRepair ? numberOfChips : 0, }, From 3e2f78dacaed617af581c567e74496f43e5857ca Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 12 Dec 2022 13:46:28 -0500 Subject: [PATCH 08/16] CSR-944-dev | Adding in required import --- src/layouts/estimate/estimate.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 2197253f2..e2e3cbb07 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -110,6 +110,7 @@ import { import experimentMixin from "@/mixins/experiment-mixin"; import { experimentSettings } from "@/constants/experiments"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; +import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; // Define Validation Rules defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); From 29b3afc3f48a58380f618d5913917cf9daf432f0 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 13 Dec 2022 10:39:12 -0500 Subject: [PATCH 09/16] Remove mounted. Add v-on. --- src/common-components/modal/modal.vue | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index e965b3e3f..23f89930a 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -2,6 +2,7 @@