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 2c28d1d49..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"; @@ -98,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 3d0d16b4a..764334544 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -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,10 +250,22 @@ 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 && !this.isRepair + return (this.isVinOptionalVehicle || + experimentMixin.methods.hasSettingEqualTo( + experimentSettings.SUPPRESS_VIN_CAPTURE, + true + )) && + !this.isRepair ? "AlertQuoteVinOptional" : "AlertQuoteReady"; }, diff --git a/src/styles/common-error-styles.scss b/src/styles/common-error-styles.scss index a9cef8dd5..0065c126d 100644 --- a/src/styles/common-error-styles.scss +++ b/src/styles/common-error-styles.scss @@ -127,12 +127,12 @@ html { background-size: 16px 12px; } .has-search-icon { - button[type="submit"] { - background-color: $red-100; - background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%23d4281c'/%3E%3C/svg%3E%0A"); - border: 1px solid $red; - border-left: none; - } + button[type="submit"] { + background-color: $red-100; + background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%23d4281c'/%3E%3C/svg%3E%0A"); + border: 1px solid $red; + border-left: none; + } } } }