diff --git a/src/constants/experiments.js b/src/constants/experiments.js index f2e5d4928..f6d25f1a7 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -4,6 +4,7 @@ const experimentUniverses = { const experimentSettings = { GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index", + SUPPRESS_VIN_CAPTURE: "SuppressVinCapture", }; const experimentTriggers = { diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 6d2b98e90..dd84c8b35 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -5,6 +5,8 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import { storeActions } from "@/constants/store-actions.js"; import { settleAllPromises } from "@/helpers/layout-helper"; +import experimentMixin from "@/mixins/experiment-mixin"; +import { experimentSettings } from "@/constants/experiments"; import store from "@/store"; import router from "@/router"; @@ -74,7 +76,9 @@ async function getLatestPageForRedirection() { fmgPageValues.CAPABILITY_QUESTIONS ); - const isVinOptionalVehicle = await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); + const isVinOptionalVehicle = store.getters.order.vehicle.make + ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) + : false; if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_YEAR; @@ -96,12 +100,18 @@ async function getLatestPageForRedirection() { } else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.PART_QUESTIONS; } else if ( + // capture vin vinLookupComponent.methods.arePagePrerequisitesValid() && !store.getters.damage.isRepair && - !isVinOptionalVehicle + !isVinOptionalVehicle && + experimentMixin.methods.hasSettingEqualTo( + experimentSettings.SUPPRESS_VIN_CAPTURE, + false + ) ) { return fmgPageValues.VIN_LOOKUP; } else { + // do not capture vin return fmgPageValues.ESTIMATE; } } diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 263fd054f..430f1df22 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -144,6 +144,16 @@ describe("getPageToRouteExistingOrderTo", () => { store.commit(storeMutations.UPDATE_IS_REPAIR, false); store.commit(storeMutations.UPDATE_MAKE, "acura"); + const mockExperimentsList = [ + { + universeName: "ConceptFunnel", + settings: { + SuppressVinCapture: false, + }, + }, + ]; + store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 4e533bb70..3a0869828 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -221,16 +221,29 @@ describe("estimate.vue", () => { describe("skipVinLookup", () => { const skipOptions = [ - [true, true, true], - [true, false, true], - [false, true, true], - [false, false, false], + [true, true, true, true], + [true, false, false, true], + [false, true, true, true], + [false, false, false, false], ]; test.each(skipOptions)( - "isRepair %s and isVinOptional %s should return %s", - async (isRepair, isVinOptionalVehicle, expectedVinSkip) => { - const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle }); + "isRepair %s, isVinOptional %s and suppressVinCapture %s should return %s", + async (isRepair, isVinOptionalVehicle, suppressVinCapture, expectedVinSkip) => { + const { wrapper } = setupMocks({}); + await wrapper.setData({ + isVinOptionalVehicle: isVinOptionalVehicle, + }); + 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); } diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 20a47e357..764334544 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -22,7 +22,7 @@
@@ -102,6 +102,8 @@ import store from "@/store"; import { storeActions } from "@/constants/store-actions"; import { vinLookupMethodSelections } from "@/constants/vin-lookup-method-selections.js"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; +import experimentMixin from "@/mixins/experiment-mixin"; +import { experimentSettings } from "@/constants/experiments"; // Define Validation Rules defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); @@ -248,7 +250,24 @@ export default { return store.getters.damage.isRepair; }, skipVinLookup() { - return this.isRepair || this.isVinOptionalVehicle; + 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"; }, }, watch: { diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 1548a74dc..135956b26 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -9,11 +9,7 @@
-