From 56ae9cd1949c0cda059ae8a24de1ee7cae59b891 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Thu, 18 Jun 2026 11:15:28 -0400 Subject: [PATCH 1/6] INSR-8493: Add MSR fee alert to service location component --- .../service-location/service-location.vue | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 0681c0f9..51ce0372 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -94,6 +94,12 @@ {{ militaryBaseWarningText }} + {{ mobileZipError }} - 0 && (this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILEDUAL || this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILE); + }, + msrFeeAlertCopy() { + let content = this.getCmsContent('AlertMSRFeeWidget', widgetFields.ALERT_WIDGET.BODY_TEXT); + content = content.replace('{custom:fee}', `$${this.mobileFeePart.sellingPrice.toFixed(2)}`); + return content; } }, watch: { From 6f0a6ce44cdb2f27e7df30e7be62582ecee875be Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Thu, 18 Jun 2026 14:59:18 -0400 Subject: [PATCH 2/6] INSR-8493: More robust MSR fee alert logic, fix custom copy --- src/helpers/recal-helper.js | 6 ++++- .../service-location/service-location.vue | 24 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/helpers/recal-helper.js b/src/helpers/recal-helper.js index 0bb650ff..5b86e63a 100644 --- a/src/helpers/recal-helper.js +++ b/src/helpers/recal-helper.js @@ -120,5 +120,9 @@ export function anyPartWithRequiresRecalFlag(lineItems) { } export function hasMSRPart(lineItems) { - return lineItems?.feeItems?.some((item) => item.partNumber === partNumberStrings.RECAL_MOBILEDUAL || item.partNumber === partNumberStrings.RECAL_MOBILE) ?? false + return lineItems?.feeItems?.some((item) => isMSRPart(item)) ?? false; +} + +export function isMSRPart(part) { + return part.partNumber === partNumberStrings.RECAL_MOBILEDUAL || part.partNumber === partNumberStrings.RECAL_MOBILE; } diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 51ce0372..991f0587 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -135,7 +135,7 @@ import { getMobileZipCodeData } from '@/helpers/service-location-helper'; import { toTitleCase } from '@/helpers/text-helper.js'; -import { isRecalOrder } from '@/helpers/recal-helper'; +import { isMSRPart, isRecalOrder } from '@/helpers/recal-helper'; // Import Component import alert from '@/ux-components/alert/alert.vue'; @@ -148,6 +148,7 @@ import recalModal from '@/iss-components/recal-modal/recal-modal.vue'; import { getPricedMobileFeePart } from '@/helpers/service-location-helper'; import { processIfStatements } from '@/helpers/cms-content-helper'; import partNumberStrings from '@/constants/part-number-strings'; +import { experimentSettings } from '@/constants/experiments'; const RECAL_MODAL_REF_NAME = 'RecalModal'; @@ -294,11 +295,28 @@ export default { return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString); }, displayMSRFeeAlert() { - return this.mobileFeePart !== null && this.mobileFeePart.sellingPrice > 0 && (this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILEDUAL || this.mobileFeePart.partNumber === partNumberStrings.RECAL_MOBILE); + if (!this.mobileFeePart || this.mobileFeePart.sellingPrice === 0 || !isMSRPart(this.mobileFeePart)) { + return false; + } + + if (this.mainStore.isITAC || this.mainStore.isNoComp) { + return true; + } + + const isSplitPayEnabled = this.getSettingValue(experimentSettings.MSR_SPLIT_PAY_ENABLED) === 'true'; + if (!isSplitPayEnabled) { + return false; + } + + if (!this.mobileFeePart.isInsurable) { + return true; + } + + return false; }, msrFeeAlertCopy() { let content = this.getCmsContent('AlertMSRFeeWidget', widgetFields.ALERT_WIDGET.BODY_TEXT); - content = content.replace('{custom:fee}', `$${this.mobileFeePart.sellingPrice.toFixed(2)}`); + content = content.replace('{custom:mobileFee}', `${this.mobileFeePart.sellingPrice.toFixed(2)}`); return content; } }, From c616ad51b41315d234b0bde28440e0d21a1bb1c0 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Thu, 18 Jun 2026 15:06:29 -0400 Subject: [PATCH 3/6] INSR-8493: Remove unused partNumberStrings import --- src/layouts/schedule-page/service-location/service-location.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 991f0587..8dac1ad7 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -147,7 +147,6 @@ import widgetFields from '@/constants/cms-widget-fields'; import recalModal from '@/iss-components/recal-modal/recal-modal.vue'; import { getPricedMobileFeePart } from '@/helpers/service-location-helper'; import { processIfStatements } from '@/helpers/cms-content-helper'; -import partNumberStrings from '@/constants/part-number-strings'; import { experimentSettings } from '@/constants/experiments'; const RECAL_MODAL_REF_NAME = 'RecalModal'; From 57a1067a3d89d1a7f5f6325ce3538f2b0e9b6233 Mon Sep 17 00:00:00 2001 From: AHumphriesSL Date: Thu, 18 Jun 2026 15:08:37 -0400 Subject: [PATCH 4/6] MSR Fee amount fix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../service-location/service-location.vue | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 8dac1ad7..875e2d61 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -294,7 +294,15 @@ export default { return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString); }, displayMSRFeeAlert() { - if (!this.mobileFeePart || this.mobileFeePart.sellingPrice === 0 || !isMSRPart(this.mobileFeePart)) { + if (!this.mobileFeePart || !isMSRPart(this.mobileFeePart)) { + return false; + } + + const mobileFeeAmount = (this.mobileFeePart.kitPrice ?? 0) + + (this.mobileFeePart.laborAmount ?? 0) + + (this.mobileFeePart.sellingPrice ?? 0); + + if (mobileFeeAmount <= 0) { return false; } @@ -307,15 +315,15 @@ export default { return false; } - if (!this.mobileFeePart.isInsurable) { - return true; - } - - return false; + return !this.mobileFeePart.isInsurable; }, msrFeeAlertCopy() { + const mobileFeeAmount = (this.mobileFeePart?.kitPrice ?? 0) + + (this.mobileFeePart?.laborAmount ?? 0) + + (this.mobileFeePart?.sellingPrice ?? 0); + let content = this.getCmsContent('AlertMSRFeeWidget', widgetFields.ALERT_WIDGET.BODY_TEXT); - content = content.replace('{custom:mobileFee}', `${this.mobileFeePart.sellingPrice.toFixed(2)}`); + content = content.replace('{custom:mobileFee}', `${mobileFeeAmount.toFixed(2)}`); return content; } }, From e875c16c20599466e65478f2340e1569d044b819 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Fri, 19 Jun 2026 13:25:17 -0400 Subject: [PATCH 5/6] INSR-8493: Restore existing mobile fee disclaimer --- .../schedule-page/service-location/service-location.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 875e2d61..4e75c4d7 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -118,6 +118,10 @@ class="d-inline-flex mt-0" role="alert">{{ mobileZipError }} + Date: Fri, 19 Jun 2026 16:36:58 -0400 Subject: [PATCH 6/6] INSR-8493: Add tests --- .../service-location/service-location.spec.js | 127 +++++++++++++++++- .../service-location/service-location.vue | 1 - 2 files changed, 124 insertions(+), 4 deletions(-) diff --git a/src/layouts/schedule-page/service-location/service-location.spec.js b/src/layouts/schedule-page/service-location/service-location.spec.js index eb77d52c..f3485ac4 100644 --- a/src/layouts/schedule-page/service-location/service-location.spec.js +++ b/src/layouts/schedule-page/service-location/service-location.spec.js @@ -4,9 +4,11 @@ import { createTestingPinia } from '@pinia/testing'; import { AppointmentTypeStrings } from '@/constants/schedule-constants'; import navigationScenarios from '@/router/router-constants/navigation-scenarios'; import routerParams from '@/router/router-constants/router-params'; -import { getPricedMobileFeePart } from '@/helpers/service-location-helper'; import { useMainStore } from '@/store'; import serviceLocation from '@/layouts/schedule-page/service-location/service-location.vue'; +import coverageTypes from '@/constants/coverage-type'; +import coverageStatuses from '@/constants/coverage-statuses'; +import { experimentSettings } from '@/constants/experiments'; const mockGetServiceabilityDetails = () => { const serviceabilityDetails = { @@ -84,12 +86,23 @@ const mockProviders = () => Promise.resolve([ isSafeliteShop: true } ]); +const defaultMobileFeePart = { + "partNumber": "RECAL MOBILEDUAL", + "description": null, + "partType": "MOBILE FEE", + "isInsurable": false, + "displayName": "Advanced mobile", + "type": null, + "laborAmount": 0, + "sellingPrice": 50, + "kitPrice": 0 +} jest.mock( '@/helpers/service-location-helper', () => ({ getZipCodeData: jest.fn((mockServiceZipCode) => mockZipcodeData(mockServiceZipCode)), getMobileZipCodeData: jest.fn((mockServiceZipCode) => mockZipcodeData(mockServiceZipCode)), - getPricedMobileFeePart: jest.fn(() => Promise.resolve(null)) + getPricedMobileFeePart: jest.fn(() => Promise.resolve(defaultMobileFeePart)) }) ); @@ -135,13 +148,17 @@ const mountOptions = { } } }; -function setupMocks({ appointmentType = AppointmentTypeStrings.IN_SHOP }) { +function setupMocks({ appointmentType = AppointmentTypeStrings.IN_SHOP, coverageStatus = coverageStatuses.PENDING, coverageType = coverageTypes.NONE }, splitPaySettingValue = 'false') { mountOptions.global.plugins = [createTestingPinia({ initialState: { main: { order: { serviceLocation: { appointmentType + }, + insuranceCoverage: { + coverageStatus, + coverageType } } } @@ -149,6 +166,23 @@ function setupMocks({ appointmentType = AppointmentTypeStrings.IN_SHOP }) { })]; useMainStore().getSafeliteProviders = jest.fn().mockImplementation(() => mockProviders()); useMainStore().getServiceabilityDetails = jest.fn((mockServiceZipCode) => mockGetServiceabilityDetails(mockServiceZipCode)); + const mockMixin = { + methods: { + getSettingValue: jest.fn((settingName) => { + if (settingName === experimentSettings.MSR_SPLIT_PAY_ENABLED) { + return splitPaySettingValue; + } + + return 'false'; + }) + } + }; + const cmsMixin = { + methods: { + getCmsContent: jest.fn(() => "") + } + } + mountOptions.mixins = [mockMixin, cmsMixin]; const wrapper = mount(serviceLocation, mountOptions); wrapper.vm.$router.navigateWithSpinner = jest.fn(); @@ -212,4 +246,91 @@ describe('service-location.vue', () => { expect(wrapper.vm.zipContainsMilitaryBase).toBe(true); }); }); + describe('computed', () => { + describe('displayMSRFeeAlert', () => { + test('returns false with no mobile fee', () => { + // Arrange + const { wrapper } = setupMocks({}); + wrapper.vm.mobileFeePart = null; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(false); + }); + + test('returns false with a mobile fee with no price', () => { + // Arrange + const { wrapper } = setupMocks({}); + wrapper.vm.mobileFeePart = { ...defaultMobileFeePart, sellingPrice: 0 }; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(false); + }); + + test('returns true for priced mobile fee for No Comp', () => { + // Arrange + const { wrapper } = setupMocks({ coverageStatus: coverageStatuses.VERIFIED, coverageType: coverageTypes.NO_COMP }); + wrapper.vm.mobileFeePart = defaultMobileFeePart; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(true); + }); + + test('returns true for priced mobile fee for ITAC', () => { + // Arrange + const { wrapper } = setupMocks({ coverageStatus: coverageStatuses.VERIFIED, coverageType: coverageTypes.ITAC }); + wrapper.vm.mobileFeePart = defaultMobileFeePart; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(true); + }); + + test('returns false for priced mobile fee for Deductible without Split Pay', () => { + // Arrange + const { wrapper } = setupMocks({ coverageStatus: coverageStatuses.VERIFIED, coverageType: coverageTypes.Deductible }, 'false'); + wrapper.vm.mobileFeePart = defaultMobileFeePart; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(false); + }); + + test('returns false for priced mobile fee for Deductible with Split Pay and isInsurable=true', () => { + // Arrange + const { wrapper } = setupMocks({ coverageStatus: coverageStatuses.VERIFIED, coverageType: coverageTypes.Deductible }, 'true'); + wrapper.vm.mobileFeePart = { ...defaultMobileFeePart, isInsurable: true }; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(false); + }); + + test('returns true for priced mobile fee for Deductible with Split Pay and isInsurable=false', () => { + // Arrange + const { wrapper } = setupMocks({ coverageStatus: coverageStatuses.VERIFIED, coverageType: coverageTypes.Deductible }, 'true'); + wrapper.vm.mobileFeePart = { ...defaultMobileFeePart, isInsurable: false }; + + // Act + const result = wrapper.vm.displayMSRFeeAlert; + + // Assert + expect(result).toBe(true); + }); + }); + }); }); diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 4e75c4d7..595cc5cb 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -308,7 +308,6 @@ export default { const mobileFeeAmount = (this.mobileFeePart.kitPrice ?? 0) + (this.mobileFeePart.laborAmount ?? 0) + (this.mobileFeePart.sellingPrice ?? 0); - if (mobileFeeAmount <= 0) { return false; }