From fc201cbf758608a90ecb7218de18ab8534e7fe77 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 13 Jul 2026 13:09:35 -0400 Subject: [PATCH 1/3] Wire up experiment Happens on Page-Entry at vehicle-damage --- src/constants/experiments.js | 10 ++++++-- .../address-lookup/address-lookup.spec.js | 25 ++++++++++++++++++- src/layouts/address-lookup/address-lookup.vue | 4 ++- .../address-vehicles/address-vehicles.spec.js | 10 +++++++- .../address-vehicles/address-vehicles.vue | 4 ++- .../license-plate-lookup.vue | 4 ++- src/layouts/vin-lookup/vin-lookup.spec.js | 10 +++++++- src/layouts/vin-lookup/vin-lookup.vue | 4 ++- 8 files changed, 62 insertions(+), 9 deletions(-) diff --git a/src/constants/experiments.js b/src/constants/experiments.js index 41a51f84..0d85e49b 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -3,6 +3,7 @@ const experimentUniverses = Object.freeze({ ISS_FEATURETOGGLE_AREFEES_HIDDEN: 'NextGenISS_FeatureToggle_AreFeesHidden', ISS_FEATURETOGGLE_AREFEES_OVERRIDDEN: 'NextGenISS_FeatureToggle_AreFeesOverridden', ISS_MOBILE_FIRST_APPOINTMENTS: 'ISS_Mobile_First_Appointments', + ISS_YMM_NOT_FOUND: 'ISS_Nextgen_YMM_Not_Found', ADYEN_PAYMENT_TEST: 'NextGenAdyenPaymentTest' }); @@ -17,16 +18,21 @@ const experimentSettings = Object.freeze({ ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS: 'MaxPmMobileDays', ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT: 'ShowMobileFirstAppointment', ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1', + ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED: 'IssEnableVinRequiredBailout', + ISS_YMMS_VIN_REQUIRED_PAGE_ENABLED: 'IssEnableVinRequiredPage', MSR_SPLIT_PAY_ENABLED: 'EnableMSRSplitPay' }); const experimentTest = Object.freeze({ - ISS_MOBILE_FIRST_POPUP_V3: 'ISS_Mobile_First_Popup_V3' + ISS_MOBILE_FIRST_POPUP_V3: 'ISS_Mobile_First_Popup_V3', + ISS_YMMS_V1: 'ISS_Nextgen_YMM_V1', }); const experimentVariation = Object.freeze({ ISS_MOBILE_FIRST_CONTROL_V3: 'NoShowMobileFirstPopUp_V3_CONTROL', - ISS_MOBILE_FIRST_TEST_V3: 'YesShowMobileFirstPopUp_V3_TEST' + ISS_MOBILE_FIRST_TEST_V3: 'YesShowMobileFirstPopUp_V3_TEST', + ISS_YMMS_CONTROL: 'ISS_Nextgen_YMM_Control', + ISS_YMMS_TEST: 'ISS_Nextgen_YMM_Test', }); const experimentTriggers = Object.freeze({ diff --git a/src/layouts/address-lookup/address-lookup.spec.js b/src/layouts/address-lookup/address-lookup.spec.js index e7bc0b16..aead77c4 100644 --- a/src/layouts/address-lookup/address-lookup.spec.js +++ b/src/layouts/address-lookup/address-lookup.spec.js @@ -3,6 +3,7 @@ import addressLookup from '@/layouts/address-lookup/address-lookup.vue'; // Supporting Files import baseMixin from '@/mixins/base-mixin'; +import { experimentSettings } from '@/constants/experiments'; import settleAllPromises from '@/helpers/layout-helper.js'; import { shallowMount } from '@vue/test-utils'; import { getMountOptions } from '@/helpers/unit-test-helper.js'; @@ -69,8 +70,16 @@ function setupMocks({ zipCode: '11111' } } + }, + mixins: { + getSettingValue: jest.fn((settingName) => { + if (settingName === experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) { + return 'true'; + } + + return 'false'; + }) } - }) ); @@ -422,6 +431,13 @@ describe('address-lookup.vue', () => { const { wrapper } = setupMocks({}, {}); wrapper.vm.navigateForwardWithSingleCarMatch = jest.fn(); + wrapper.vm.getSettingValue = jest.fn((settingName) => { + if (settingName === experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) { + return 'true'; + } + + return 'false'; + }); useMainStore().order.vehicle.carId = 'C0000'; @@ -457,6 +473,13 @@ describe('address-lookup.vue', () => { const { wrapper } = setupMocks({}); wrapper.vm.navigateForwardWithSingleCarMatch = jest.fn(); + wrapper.vm.getSettingValue = jest.fn((settingName) => { + if (settingName === experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) { + return 'true'; + } + + return 'false'; + }); useMainStore().order.vehicle.carId = 'CARID3'; diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 52fe0050..bc61bb89 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -81,6 +81,7 @@ import alert from '@/ux-components/alert/alert.vue'; import { Form } from 'vee-validate'; // Supporting files +import { experimentSettings } from '@/constants/experiments'; import { fetchCmsContentForPage } from '@/helpers/cms-content-helper'; import settleAllPromises from '@/helpers/layout-helper'; import routerParams from '@/router/router-constants/router-params'; @@ -344,7 +345,8 @@ export default { { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } ); } else if (matchingCars.length === 1) { - if (this.mainStore.order.vehicle.vinRequired) { + const ymmsBailoutEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED); + if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) { this.mainStore.setBailout(bailoutMessage.YMMNotFound()); return this.$router.navigate( this.navigationScenarios.BAILOUT, diff --git a/src/layouts/address-vehicles/address-vehicles.spec.js b/src/layouts/address-vehicles/address-vehicles.spec.js index 141519cd..bb2c83f2 100644 --- a/src/layouts/address-vehicles/address-vehicles.spec.js +++ b/src/layouts/address-vehicles/address-vehicles.spec.js @@ -1,5 +1,6 @@ import addressVehicles from '@/layouts/address-vehicles/address-vehicles.vue'; import baseMixin from '@/mixins/base-mixin'; +import { experimentSettings } from '@/constants/experiments'; import settleAllPromises from '@/helpers/layout-helper.js'; import { shallowMount } from '@vue/test-utils'; import { getMountOptions } from '@/helpers/unit-test-helper.js'; @@ -104,7 +105,14 @@ function setupMocks({ return 'VehicleConfirmationQuestionTestReturn'; } return null; - }) + }), + getSettingValue: jest.fn((settingName) => { + if (settingName === experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) { + return 'true'; + } + + return 'false'; + }), }, computed: { dynamicStrings() { diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 7b651e7b..84bea124 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -72,6 +72,7 @@ import settleAllPromises from '@/helpers/layout-helper'; import { useMainStore } from '@/store'; import issPageValues from '@/router/router-constants/issPage-values'; import errorMessages from '@/constants/error-messages'; +import { experimentSettings } from '@/constants/experiments'; import { required } from '@/helpers/validation-rules'; import { Form, defineRule } from 'vee-validate'; import { isGlassAvailableForCarId } from '@/helpers/damage-helper'; @@ -256,7 +257,8 @@ export default { false ); - if (this.mainStore.order.vehicle.vinRequired) { + const ymmsBailoutEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED); + if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) { this.mainStore.setBailout(bailoutMessage.YMMNotFound()); return this.$router.navigate( this.navigationScenarios.BAILOUT, diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index d70c7b39..a86995c8 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -78,6 +78,7 @@ import settleAllPromises from '@/helpers/layout-helper'; import { useMainStore } from '@/store'; import bailoutMessage from '@/constants/bailoutMessage'; import errorMessages from '@/constants/error-messages'; +import { experimentSettings } from '@/constants/experiments'; import { required } from '@/helpers/validation-rules'; import { defineRule, Form } from 'vee-validate'; import { @@ -304,7 +305,8 @@ export default { } }); - if (this.mainStore.order.vehicle.vinRequired) { + const ymmsBailoutEnabled = this.getSettingValue(experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED); + if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) { this.mainStore.setBailout(bailoutMessage.YMMNotFound()); return this.$router.navigate( this.navigationScenarios.BAILOUT, diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index 820d2820..b5e9efe6 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -5,6 +5,7 @@ import baseMixin from '@/mixins/base-mixin'; import { createTestingPinia } from '@pinia/testing'; import userEvent from '@testing-library/user-event'; import errorMessages from '@/constants/error-messages'; +import { experimentSettings } from '@/constants/experiments'; import issPageValues from '@/router/router-constants/issPage-values'; import queryStrings from '@/constants/query-strings'; import { GaActions } from '@/constants/analytics'; @@ -172,7 +173,14 @@ const mountOptions = { getFooterInfoBoxHeight: jest.fn(() => 80), cssClassNameForCmsWidget: jest.fn(() => 'widget-name-mock-class'), getPageNameByQueryString: jest.fn(() => ''), - pushEventToGA: jest.fn() + pushEventToGA: jest.fn(), + getSettingValue: jest.fn((settingName) => { + if (settingName === experimentSettings.ISS_YMMS_VIN_REQUIRED_BAILOUT_ENABLED) { + return 'true'; + } + + return 'false'; + }) }, computed: { GaActions() { diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 1729c3c7..ca20daf0 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -42,6 +42,7 @@