From cb7e4fa714efc9de9b0dcbeb15f2656909056b85 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 18 Mar 2026 11:07:11 -0400 Subject: [PATCH 1/3] remove Labor2 from supporting items --- src/constants/part-number-strings.js | 3 ++- src/store/index.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/constants/part-number-strings.js b/src/constants/part-number-strings.js index a72684f8..dbfa87ad 100644 --- a/src/constants/part-number-strings.js +++ b/src/constants/part-number-strings.js @@ -1,5 +1,6 @@ const partNumberStrings = Object.freeze({ - RECYCLE_FEE: 'RECYCLE FEE' + RECYCLE_FEE: 'RECYCLE FEE', + LABOR2: 'LABOR2', }); export default partNumberStrings; diff --git a/src/store/index.js b/src/store/index.js index 59df6e99..cf2e9904 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1941,8 +1941,8 @@ export const useMainStore = defineStore({ // Process Recycle Fee this.updateRecycleFee(partsData.find((rf) => rf.partNumber === partNumberStrings.RECYCLE_FEE)); - // Remove RecycleFee from supported items as it's saved in feeItems; - this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE); + // Remove RecycleFee and Labor2 from supporting items as they're saved in feeItems; + this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE && i.partNumber !== partNumberStrings.LABOR2); }, updateVaps(partsData) { From d6298e9baf679a137470f6b00efe801c4ae0149c Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 18 Mar 2026 11:30:26 -0400 Subject: [PATCH 2/3] add unit test --- src/store/store.spec.js | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 0e0900d2..c889904d 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -2489,4 +2489,64 @@ describe('Store', () => { expect(store.order.contactInfo.alternativePhone).toBeUndefined(); }); }); + describe('updateSupportingItems method', () => { + it('updateSupportingItems removes Recyle Fee and Labor2 Fee from supporting items in store', () => { + // Arrange + const partsData = [ + { + partNumber: 'RECYCLE FEE', + partType: 'REPLACE FEE' + }, + { + partNumber: 'LABOR2', + partType: 'NON_GLASS' + } + ]; + + // Act + store.updateSupportingItems(partsData); + + // Assert + expect.not.objectContaining({ + partNumber: 'RECYCLE FEE', + partType: 'REPLACE FEE' + }); + expect.not.objectContaining({ + partNumber: 'LABOR2', + partType: 'NON_GLASS' + }); + }); + it('updatePhoneNumbers updates phone info in store', () => { + // Arrange + const homePhone = getRandomInt(1000000000, 9999999999); + const servicePhone = getRandomInt(1000000000, 9999999999); + const altPhone = getRandomInt(1000000000, 9999999999); + const extension = getRandomInt(10000, 99999); + + // Act + store.updatePhoneNumbers({ + home: homePhone, + service: servicePhone, + alternative: altPhone, + extension + }); + + // Assert + expect(store.contactInfo.homePhone).toEqual(homePhone); + expect(store.contactInfo.servicePhone).toEqual(servicePhone); + expect(store.contactInfo.alternativePhone).toEqual(altPhone); + expect(store.contactInfo.extension).toEqual(extension); + }); + it('All null values => contact info set in store to all null/default', () => { + // Act + store.updateContactInfo({}); + + // Assert + expect(store.contactInfo.firstName).toEqual(null); + expect(store.contactInfo.lastName).toEqual(null); + expect(store.contactInfo.emailAddress).toEqual(null); + expect(store.contactInfo.requestTextUpdates).toEqual(false); + expect(store.contactInfo.notesForTechnician).toEqual(''); + }); + }); }); From f7aa75105465ea8d36a3807bb6910df2281bc449 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 18 Mar 2026 11:31:36 -0400 Subject: [PATCH 3/3] remove duplicate code --- src/store/store.spec.js | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/store/store.spec.js b/src/store/store.spec.js index c889904d..bd601c24 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -2516,37 +2516,5 @@ describe('Store', () => { partType: 'NON_GLASS' }); }); - it('updatePhoneNumbers updates phone info in store', () => { - // Arrange - const homePhone = getRandomInt(1000000000, 9999999999); - const servicePhone = getRandomInt(1000000000, 9999999999); - const altPhone = getRandomInt(1000000000, 9999999999); - const extension = getRandomInt(10000, 99999); - - // Act - store.updatePhoneNumbers({ - home: homePhone, - service: servicePhone, - alternative: altPhone, - extension - }); - - // Assert - expect(store.contactInfo.homePhone).toEqual(homePhone); - expect(store.contactInfo.servicePhone).toEqual(servicePhone); - expect(store.contactInfo.alternativePhone).toEqual(altPhone); - expect(store.contactInfo.extension).toEqual(extension); - }); - it('All null values => contact info set in store to all null/default', () => { - // Act - store.updateContactInfo({}); - - // Assert - expect(store.contactInfo.firstName).toEqual(null); - expect(store.contactInfo.lastName).toEqual(null); - expect(store.contactInfo.emailAddress).toEqual(null); - expect(store.contactInfo.requestTextUpdates).toEqual(false); - expect(store.contactInfo.notesForTechnician).toEqual(''); - }); }); });