Wire up experiment
Happens on Page-Entry at vehicle-damage
This commit is contained in:
parent
a34df4b754
commit
fc201cbf75
8 changed files with 62 additions and 9 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<script>
|
||||
// Import Supporting Files
|
||||
import { computed } from 'vue';
|
||||
import { experimentSettings } from '@/constants/experiments';
|
||||
import vehicleLookupAlertTypes from '@/constants/vehicle-lookup-alert-types';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { isGlassAvailableForCarId } from '@/helpers/damage-helper';
|
||||
|
|
@ -176,7 +177,8 @@ export default {
|
|||
this.$refs.siteFooter.enableForwardAction();
|
||||
showIssLoadingModal(true);
|
||||
|
||||
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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue