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(''); + }); + }); });