Merge pull request #1202 from Safelite/feature/kroell/INSR-9415

INSR-9415: fix recal copy logic on payment-method
This commit is contained in:
katiekroell 2026-04-24 11:04:22 -04:00 committed by GitHub
commit cc460e8fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 15 deletions

View file

@ -14,7 +14,7 @@ import { useMainStore } from '@/store';
import { getPriceOfLineItems } from '@/helpers/price-calculator.js';
import coverageStatuses from '@/constants/coverage-statuses';
import coverageType from '@/constants/coverage-type';
import { containsRecalParts } from '@/helpers/recal-helper';
import { isRecalOrder } from '@/helpers/recal-helper';
jest.mock('@/helpers/layout-helper.js', () => jest.fn());
jest.mock('@/helpers/price-calculator.js', () => ({
@ -34,7 +34,7 @@ jest.mock('@/helpers/text-helper', () => ({
}));
jest.mock('@/helpers/recal-helper.js', () => ({
containsRecalParts: jest.fn()
isRecalOrder: jest.fn()
}));
const SAFELITE_PROVIDER = 'Safelite';
@ -345,7 +345,7 @@ describe('coverageStatement.vue', () => {
});
test('returns true when a part in glassParts requires recalibration and recalibration has been added to order', () => {
// Arrange
containsRecalParts.mockReturnValue(true);
isRecalOrder.mockReturnValue(true);
const mainInitialState = {
order: {
lineItems: {

View file

@ -149,7 +149,7 @@ import { getAvailableLineItems } from '@/helpers/cart-helper';
import coverageStatuses from '@/constants/coverage-statuses';
import coverageType from '@/constants/coverage-type';
import oemEndorsementModal from '@/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue';
import { containsRecalParts } from '@/helpers/recal-helper';
import { isRecalOrder } from '@/helpers/recal-helper';
const RECAL_MODAL_REF_NAME = 'RecalModal';
const CANCEL_CLAIM_REF_NAME = 'CancelClaimModal';
@ -308,13 +308,7 @@ export default {
return this.mainStore.isUnverified;
},
isADAS() {
const { glassParts } = useMainStore().order.lineItems;
const orderContainsRecalPart = containsRecalParts(glassParts);
return (
glassParts !== null
&& !!glassParts.find((part) => part.requiresRecalibration)
&& orderContainsRecalPart
);
return isRecalOrder(this.mainStore.order.lineItems);
},
totalServicePrice() {
return getPriceOfLineItems(this.baseServiceLineItems);

View file

@ -8,6 +8,7 @@
<script>
import { getStringWithCustomValues, processIfStatements } from '@/helpers/cms-content-helper';
import { getGlassList } from '@/helpers/damage-helper';
import { isRecalOrder } from '@/helpers/recal-helper';
import reviewBlock from '@/layouts/payment-method/review-dropdown/review-block/review-block.vue';
export default {
@ -34,12 +35,16 @@ export default {
customValueMap() {
return {
glassList: this.glassList,
isRecalibrationOnOrder: this.isRecalibrationOnOrder
};
},
glassList() {
const glassPieces = this.mainStore.lineItems.glassParts?.map((part) => part.partType.toLowerCase()) ?? [];
return getGlassList(glassPieces);
},
isRecalibrationOnOrder() {
return isRecalOrder(this.mainStore.order.lineItems);
}
},
methods: {
getCmsContentWithCustomValues(widgetName, widgetField) {

View file

@ -133,7 +133,7 @@ import {
getMobileZipCodeData
} from '@/helpers/service-location-helper';
import { toTitleCase } from '@/helpers/text-helper.js';
import { containsRecalParts } from '@/helpers/recal-helper';
import { isRecalOrder } from '@/helpers/recal-helper';
// Import Component
import alert from '@/ux-components/alert/alert.vue';
@ -244,7 +244,7 @@ export default {
|| this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
},
isRecalibrationOnOrder() {
return this.mainStore.hasRecalibrationPart && containsRecalParts(this.mainStore.order.lineItems);
return isRecalOrder(this.mainStore.order.lineItems);
},
isServiceableInshop() {
if (this.isRecalibrationServiceableInshop !== null) {

View file

@ -23,7 +23,7 @@ import partTypeStrings from '@/constants/part-type-strings';
import { useMainStore } from '@/store';
import { getPriceOfLineItem } from '@/helpers/price-calculator';
import { shallowRef } from 'vue';
import { containsRecalParts } from '@/helpers/recal-helper';
import { isRecalOrder } from '@/helpers/recal-helper';
const glassLocations = damageLocationsSelected;
@ -101,7 +101,7 @@ export default {
return modifiedAnswers;
},
isRecalibrationOnOrder() {
return this.mainStore.hasRecalibrationPart && containsRecalParts(this.mainStore.order.lineItems);
return isRecalOrder(this.mainStore.order.lineItems);
},
frontWipersApplicableForTierTwo() {
const frontWipersAreAvailable = this.lineItemsContainsPartType(partTypeStrings.FRONT_WIPER);