From 7f5a91c6d44c18d7e22e32726a821e5ce7c02e07 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Wed, 13 May 2026 14:50:04 -0400 Subject: [PATCH 1/2] INSR-9651: Do not clear VAPs prices on deductible submit This is so that we pricing data in the call to Safelite API, so that the confirmation email contains the correct pricing information. --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index cd4216ba..54f97918 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1440,7 +1440,7 @@ export const useMainStore = defineStore({ const shouldClearOnSubmit = this.isVerified && this.isDeductible; const payloadGlassParts = setClearOnSubmit(lineItems.glassParts, shouldClearOnSubmit); const payloadSupportingItems = setClearOnSubmit(lineItems.supportingItems, shouldClearOnSubmit); - const payloadVapsItems = setClearOnSubmit(lineItems.vaps, shouldClearOnSubmit); + const payloadVapsItems = setClearOnSubmit(lineItems.vaps, false); const payloadFeeItems = setClearOnSubmit(lineItems.feeItems, shouldClearOnSubmit); const payload = { From 3236ce79c40f5e191df5df0ad1ce58df6450ed82 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Thu, 14 May 2026 09:51:04 -0400 Subject: [PATCH 2/2] Add new test to handle different clearOnSubmit scenarios --- src/store/store.spec.js | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 157c34ec..7b9d4355 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -796,7 +796,43 @@ describe('Store', () => { }) })); }); - it('calls api with expected lineItems', async () => { + it('calls api with expected lineItems for verified deductible', async () => { + // Arrange + const glassParts = [{ + partNumber: getRandomString(6, 6), + clearOnSubmit: true + }]; + const supportingItems = [{ + partNumber: getRandomString(6, 6), + clearOnSubmit: true + }]; + const vaps = [{ + partNumber: getRandomString(6, 6), + clearOnSubmit: false + }]; + store.order.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED; + store.order.insuranceCoverage.coverageType = coverageType.Deductible; + store.order.lineItems.glassParts = glassParts; + store.order.lineItems.supportingItems = supportingItems; + store.order.lineItems.vaps = vaps; + + globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve({})); + + // Act + await store.saveSession({}); + + // Assert + expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining({ + payload: expect.objectContaining({ + lineItems: expect.objectContaining({ + glassParts, + supportingItems, + vaps + }) + }) + })); + }); + it('calls api with expected lineItems for other coverage types', async () => { // Arrange const glassParts = [{ partNumber: getRandomString(6, 6),