From c2aa73cf7c8fd7b492069c84eb4a561fa3ca21ef Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 6 Jan 2025 14:15:58 -0500 Subject: [PATCH 1/2] CASH-80 CASH-80 allow heritage to redirect to insurance company page now. --- src/helpers/heritage-integration/navigation-helper.js | 5 +---- src/layouts/customer-details/customer-details.vue | 2 +- src/layouts/vehicle/vehicle.vue | 2 +- src/router/index.js | 4 +++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 5e71bb5b7..3090ccb1c 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -42,10 +42,7 @@ export async function getDirectNavigation(toRoute) { return fmgPageValues.VEHICLE_DAMAGE; } - if ( - fmgPageValue === fmgPageValues.QUOTE || - fmgPageValue === fmgPageValues.INSURANCE_COMPANY - ) { + if (fmgPageValue === fmgPageValues.QUOTE) { const skipVin = await skipVinLookup(); if (skipVin) { diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 820d5ddc1..6775e36da 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -183,7 +183,7 @@ export default { ); // if the user has resorted to using browser back/forward buttons we could have promises unresolved if they clicked back before pia work order submission. - // so attempt to wait for them to finish. + // so attempt to wait for them to finish. if (store.getters.order.payment.isPia) { this.dispatchStoreAction( storeActions.SAVE_PAYMENT_METHOD_CHOICE, diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 18eee6988..1009b9713 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -402,7 +402,7 @@ export default { !options.length || store.getters.payment?.insuranceCoverage?.isVerified || (store.getters.order.payment?.isInsurance && - getFunnelCookie().HasDelayedClaimRegistration) + getFunnelCookie()?.HasDelayedClaimRegistration) ) { return true; } else { diff --git a/src/router/index.js b/src/router/index.js index 833a359b7..7c1738464 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -113,6 +113,7 @@ const routes = [ store.commit(storeMutations.UPDATE_AFFILIATE_COOKIES, affiliateCookies); } setupAdvertiserTracking(); + log(" --load session start"); const loadSessionResponse = await loadSessionIfPresent( to.query.isInsurance != null ? to.query.isInsurance == "true" @@ -121,6 +122,7 @@ const routes = [ : null, to.query.fmgPage ); + log(" --load session end"); //Update external parameter state but not when returning from heritage if (!to.query.fmgPage?.startsWith("service-location")) { @@ -388,7 +390,7 @@ router.navigateWithSaving = ( router.navigateToExternalUrl = (url, optionalQuery = {}) => { log("------------- router navigateToExternalUrl -----------------"); - log("url:", url) + log("url:", url); navigateToUrl(url, optionalQuery); }; From 68b76c5f0d1d2b299bb75b95d247d9a692f297a9 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 6 Jan 2025 14:52:16 -0500 Subject: [PATCH 2/2] CASH-80 correct test CASH-80 correct test --- .../navigation-helper.spec.js | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 2af724828..ae20659f5 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -400,26 +400,6 @@ describe("getPageToRouteExistingOrderTo", () => { // Assert expect(result).toBe(fmgPageValues.ESTIMATE); }); - - test("Replace navigation to `insurance-company` with `estimate`", async () => { - // Arrange - const toRoute = { - query: { - fmgPage: fmgPageValues.INSURANCE_COMPANY, - }, - }; - - store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); - store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); - store.commit(storeMutations.UPDATE_IS_REPAIR, true); - store.commit(storeMutations.UPDATE_MAKE, "acura"); - - // Act - const result = await getPageToRouteExistingOrderTo(toRoute); - - // Assert - expect(result).toBe(fmgPageValues.ESTIMATE); - }); }); describe("Vin-Required", () => { @@ -445,29 +425,6 @@ describe("getPageToRouteExistingOrderTo", () => { // Assert expect(result).toBe(fmgPageValues.VIN_LOOKUP); }); - - test("Replace navigation to `insurance-company` with `vin-lookup`", async () => { - // Arrange - const toRoute = { - query: { - fmgPage: fmgPageValues.INSURANCE_COMPANY, - }, - }; - - store.commit(storeMutations.UPDATE_IS_VERIFIED_INSURANCE, true); - store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, "666666"); - store.commit(storeMutations.UPDATE_IS_REPAIR, false); - store.commit(storeMutations.UPDATE_MAKE, "acura"); - store.commit(storeMutations.UPDATE_GLASS_TO_REPLACE, [ - { glassLocation: glassLocations.WINDSHIELD }, - ]); - - // Act - const result = await getPageToRouteExistingOrderTo(toRoute); - - // Assert - expect(result).toBe(fmgPageValues.VIN_LOOKUP); - }); }); });