updated the branch

This commit is contained in:
Uday Boppa 2026-07-14 11:34:00 -04:00
parent c28624a9a7
commit 614afea2e6
11 changed files with 172 additions and 9 deletions

View file

@ -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({

View file

@ -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';

View file

@ -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) === 'true';
if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) {
this.mainStore.setBailout(bailoutMessage.YMMNotFound());
return this.$router.navigate(
this.navigationScenarios.BAILOUT,

View file

@ -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() {

View file

@ -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) === 'true';
if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) {
this.mainStore.setBailout(bailoutMessage.YMMNotFound());
return this.$router.navigate(
this.navigationScenarios.BAILOUT,

View file

@ -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) === 'true';
if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) {
this.mainStore.setBailout(bailoutMessage.YMMNotFound());
return this.$router.navigate(
this.navigationScenarios.BAILOUT,

View file

@ -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() {

View file

@ -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) === 'true';
if (ymmsBailoutEnabled && this.mainStore.order.vehicle.vinRequired) {
this.mainStore.setBailout(bailoutMessage.YMMNotFound());
return this.$router.navigate(
this.navigationScenarios.BAILOUT,

View file

@ -28,6 +28,7 @@ import coverageStatuses from '@/constants/coverage-statuses';
import coverageType from '@/constants/coverage-type';
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
import { useMainStore } from '@/store';
import BailoutCode from '@/constants/bailoutCode';
function pushToDataLayerIfDefined(data) {
if (window.dataLayer !== undefined) {
@ -448,6 +449,19 @@ export default {
const issConfig = store.issConfig;
const applicationUser = store.applicationUser;
// Bailout info for analytics. We use combined string to send to analytics - BailoutCode_BailoutString - ex: 15_ApiError
const bailoutCode = store.bailoutCode;
let bailoutCombinedString = "";
try {
if (bailoutCode !== null && bailoutCode !== undefined) {
const bailoutString =
Object.keys(BailoutCode).find((key) => BailoutCode[key] === bailoutCode) ?? "";
bailoutCombinedString = bailoutString ? `${bailoutCode}_${bailoutString}` : `${bailoutCode}`;
}
} catch (error) {
// Do not let error here stop logging.
}
// Use parentaccount on order, use parentaccount on issconfig as fallback.
const parentAccountNumber = (order.parentAccountNumber ?? issConfig.parentAccountNumber).toString();
@ -563,6 +577,8 @@ export default {
sessionData.userAgent = navigator.userAgent;
sessionData.bailoutCodeValue = bailoutCombinedString;
store.logIssSessionData(sessionData);
},

View file

@ -105,6 +105,98 @@ describe('analyticsMixin.js', () => {
expect(expectedDataLayer).toEqual(expect.arrayContaining(window.dataLayer));
});
test('pushIssSessionData: logs session payload to store', () => {
// Arrange
const store = useMainStore();
const testCookieValue = {
sid: '10000000-0000-0000-0000-000000000001',
skey: '12345'
};
setupCookies({ ISSCookieValue: JSON.stringify(testCookieValue) });
store.bailoutCode = 15;
store.applicationUser.savedSessionId = 'saved-session-id';
store.applicationUser.pageData = {
quote: {
servicePackageSelected: 'BASIC_PACKAGE'
}
};
store.order.parentAccountNumber = 11111111;
store.order.vehicle = {
carId: 'CAR123',
year: '2020',
make: 'Toyota',
model: 'Camry',
style: 'SE',
vin: '1ABCDEFGH12345678'
};
store.order.damage = {
isRepair: false,
glassToReplace: [{ glassLocation: 'Windshield', glassName: 'Front' }]
};
store.order.lineItems = {
glassParts: [{ partNumber: 'GP1', partType: 'Glass', childParts: [] }],
supportingItems: [{ partNumber: 'SUP1', partType: 'Adas' }],
vaps: [{ partNumber: 'VAP1', partType: 'Vap' }]
};
store.order.schedule = { date: '2026-01-01', startTime: '09:00' };
store.order.serviceLocation = {
appointmentType: 'Mobile',
provider: {
address: {
zipCode: '43081',
zipCodeCtu: '43081'
}
},
zipCode: '43081',
zipCodeCtu: '43081'
};
store.order.contactInfo = {
notesForTechnician: 'note',
requestTextUpdates: true
};
store.order.payment = {
paymentMethod: 'Card',
nextGenSettledAmount: 100
};
store.order.insuranceCoverage = {
coverageStatus: 3,
coverageType: 1
};
store.order.eon = 'EON123';
store.order.referralNumber = 'R123';
store.order.referralSequenceNumber = '1';
store.order.referralDate = '2026-01-01';
store.order.workOrderNumber = 'WO123';
store.order.workOrderId = 'WOID123';
store.issConfig.parentAccountNumber = 99999999;
store.issConfig.billToAccountNumber = 'BILL123';
store.issConfig.clientName = 'Test Insurance';
store.currentDeductible = 250;
store.isVerified = true;
store.isNoComp = false;
store.isITAC = false;
const context = {
getPageNameByQueryString: jest.fn().mockReturnValue('duplicate-check')
};
// Act
analyticsMixin.methods.pushIssSessionData.call(context);
// Assert
expect(store.logIssSessionData).toHaveBeenCalledTimes(1);
expect(store.logIssSessionData).toHaveBeenCalledWith(expect.objectContaining({
currentPage: 'duplicate-check',
referralNumber: 'R123',
issSessionId: 'saved-session-id',
parentAccountNumber: '11111111',
hasVin: true,
damageType: 'Replace',
productType: expect.arrayContaining(['GP1-Glass', 'SUP1-Adas', 'VAP1-Vap', 'BASIC_PACKAGE'])
}));
});
test('Experiments, should push to dataLayer with default Google Custom Dimension Index', () => {
// Arrange
const store = useMainStore();

View file

@ -2819,6 +2819,7 @@ export const useMainStore = defineStore({
totalPrice,
userAgent,
cashPriceSubTotal,
bailoutCodeValue,
}
) {
var payload = {
@ -2870,6 +2871,7 @@ export const useMainStore = defineStore({
userAgent: userAgent,
cashPriceSubTotal: cashPriceSubTotal,
billToAccountNumber: billToAccountNumber,
bailoutCode: bailoutCodeValue,
};
return globalMethods.callHttpClient({