diff --git a/src/layouts/contact-details/contact-details.spec.js b/src/layouts/contact-details/contact-details.spec.js index 7930b319..58d16b8e 100644 --- a/src/layouts/contact-details/contact-details.spec.js +++ b/src/layouts/contact-details/contact-details.spec.js @@ -160,14 +160,16 @@ describe('contactDetails.vue', () => { const firstName = getRandomString(4, 15); const lastName = getRandomString(4, 15); const emailAddress = getRandomString(10, 20); - const phoneNumber = getRandomInt(1000000000, 9999999999); + const servicePhone = getRandomInt(1000000000, 9999999999).toString(); const mainInitialState = { order: { customer: { firstName, lastName, - emailAddress, - phoneNumber + emailAddress + }, + contactInfo: { + servicePhone } } }; @@ -185,7 +187,7 @@ describe('contactDetails.vue', () => { expect(wrapper.vm.firstName).toBe(firstName); expect(wrapper.vm.lastName).toBe(lastName); expect(wrapper.vm.emailAddress).toBe(emailAddress); - expect(wrapper.vm.phoneNumber).toBe(phoneNumber); + expect(wrapper.vm.phoneNumber).toBe(servicePhone); }); test('Mock store with contact info yields expected data', () => { // Arrange @@ -199,7 +201,7 @@ describe('contactDetails.vue', () => { firstName: getRandomString(4, 15), lastName: getRandomString(4, 15), emailAddress: getRandomString(10, 20), - phoneNumber: getRandomInt(1000000000, 9999999999), + servicePhone: getRandomInt(1000000000, 9999999999), requestTextUpdates: getRandomBoolean(), notesForTechnician: getRandomString(50, 100) }; @@ -224,7 +226,7 @@ describe('contactDetails.vue', () => { expect(wrapper.vm.firstName).toBe(contactInfo.firstName); expect(wrapper.vm.lastName).toBe(contactInfo.lastName); expect(wrapper.vm.emailAddress).toBe(contactInfo.emailAddress); - expect(wrapper.vm.phoneNumber).toBe(contactInfo.phoneNumber); + expect(wrapper.vm.phoneNumber).toBe(contactInfo.servicePhone); expect(wrapper.vm.requestTextUpdates).toBe(contactInfo.requestTextUpdates); expect(wrapper.vm.notesForTechnician).toBe(contactInfo.notesForTechnician); }); @@ -315,7 +317,7 @@ describe('contactDetails.vue', () => { const firstName = getRandomString(4, 15); const lastName = getRandomString(4, 15); const emailAddress = getRandomString(10, 20); - const phoneNumber = getRandomInt(1000000000, 9999999999); + const phoneNumber = getRandomInt(1000000000, 9999999999).toString(); const requestTextUpdates = getRandomBoolean(); const notesForTechnician = getRandomString(1, 100); wrapper.setData({ @@ -335,11 +337,60 @@ describe('contactDetails.vue', () => { firstName, lastName, emailAddress, - phoneNumber, requestTextUpdates, notesForTechnician }); }); + + test('Forward button click updates phone numbers request text updates', () => { + // Arrange + const mountOptions = getMountOptions({ + router: { + navigate: jest.fn() + } + }); + const wrapper = shallowMount(contactDetails, mountOptions); + const phoneNumber = getRandomInt(1000000000, 9999999999).toString(); + const requestTextUpdates = true; + wrapper.setData({ + phoneNumber, + requestTextUpdates + }); + + // Act + wrapper.vm.forwardButtonAction(); + + // Assert + expect(useMainStore().updatePhoneNumbers).toHaveBeenCalledWith({ + service: phoneNumber, + alternative: phoneNumber + }); + }); + + test('Forward button click updates phone numbers dot not request text updates', () => { + // Arrange + const mountOptions = getMountOptions({ + router: { + navigate: jest.fn() + } + }); + const wrapper = shallowMount(contactDetails, mountOptions); + const phoneNumber = getRandomInt(1000000000, 9999999999).toString(); + const requestTextUpdates = false; + wrapper.setData({ + phoneNumber, + requestTextUpdates + }); + + // Act + wrapper.vm.forwardButtonAction(); + + // Assert + expect(useMainStore().updatePhoneNumbers).toHaveBeenCalledWith({ + home: phoneNumber, + service: phoneNumber + }); + }); }); test('Mocked store with no contact info yields expected data', () => { @@ -349,20 +400,19 @@ describe('contactDetails.vue', () => { const firstName = getRandomString(4, 15); const lastName = getRandomString(4, 15); const emailAddress = getRandomString(10, 20); - const phoneNumber = getRandomInt(1000000000, 9999999999); + const servicePhone = getRandomInt(1000000000, 9999999999); const mainInitialState = { order: { customer: { firstName, lastName, - emailAddress, - phoneNumber + emailAddress }, contactInfo: { firstName: null, lastName: null, emailAddress: null, - phoneNumber: null, + servicePhone, requestTextUpdates: null, notesForTechnician: null } @@ -382,7 +432,7 @@ describe('contactDetails.vue', () => { expect(wrapper.vm.firstName).toBe(firstName); expect(wrapper.vm.lastName).toBe(lastName); expect(wrapper.vm.emailAddress).toBe(emailAddress); - expect(wrapper.vm.phoneNumber).toBe(phoneNumber); + expect(wrapper.vm.phoneNumber).toBe(servicePhone); }); test('Mock store with contact info yields expected data', () => { @@ -397,7 +447,7 @@ describe('contactDetails.vue', () => { firstName: getRandomString(4, 15), lastName: getRandomString(4, 15), emailAddress: getRandomString(10, 20), - phoneNumber: getRandomInt(1000000000, 9999999999), + servicePhone: getRandomInt(1000000000, 9999999999), requestTextUpdates: getRandomBoolean(), notesForTechnician: getRandomString(50, 100) }; @@ -422,7 +472,7 @@ describe('contactDetails.vue', () => { expect(wrapper.vm.firstName).toBe(contactInfo.firstName); expect(wrapper.vm.lastName).toBe(contactInfo.lastName); expect(wrapper.vm.emailAddress).toBe(contactInfo.emailAddress); - expect(wrapper.vm.phoneNumber).toBe(contactInfo.phoneNumber); + expect(wrapper.vm.phoneNumber).toBe(contactInfo.servicePhone); expect(wrapper.vm.requestTextUpdates).toBe(contactInfo.requestTextUpdates); expect(wrapper.vm.notesForTechnician).toBe(contactInfo.notesForTechnician); }); diff --git a/src/layouts/contact-details/contact-details.vue b/src/layouts/contact-details/contact-details.vue index dcca28ee..ceec1259 100644 --- a/src/layouts/contact-details/contact-details.vue +++ b/src/layouts/contact-details/contact-details.vue @@ -139,14 +139,14 @@ export default { const { firstName, lastName, emailAddress, - phoneNumber, + servicePhone, requestTextUpdates, notesForTechnician } = useMainStore().contactInfo; return { firstName, lastName, emailAddress, - phoneNumber, + phoneNumber: servicePhone, requestTextUpdates, notesForTechnician, widget: { @@ -196,11 +196,23 @@ export default { firstName: this.firstName, lastName: this.lastName, emailAddress: this.emailAddress, - phoneNumber: this.phoneNumber, requestTextUpdates: this.requestTextUpdates, notesForTechnician: this.notesForTechnician }; useMainStore().updateContactInfo(contactInfo); + + if (this.requestTextUpdates) { + useMainStore().updatePhoneNumbers({ + service: this.phoneNumber, + alternative: this.phoneNumber + }); + } else { + useMainStore().updatePhoneNumbers({ + home: this.phoneNumber, + service: this.phoneNumber + }); + } + const scenario = useMainStore().order.serviceLocation.IsSafeliteProvider === false ? this.navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP : this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP; diff --git a/src/layouts/order-confirmation/order-confirmation.spec.js b/src/layouts/order-confirmation/order-confirmation.spec.js index c38a062e..2eb8208e 100644 --- a/src/layouts/order-confirmation/order-confirmation.spec.js +++ b/src/layouts/order-confirmation/order-confirmation.spec.js @@ -76,7 +76,7 @@ const initialStore = { contactInfo: { firstName: 'Test', lastName: 'Test', - phoneNumber: '111-111-1111', + servicePhone: '111-111-1111', emailAddress: 'test@email.com' } } diff --git a/src/layouts/order-confirmation/order-confirmation.vue b/src/layouts/order-confirmation/order-confirmation.vue index c045f651..b7e1af75 100644 --- a/src/layouts/order-confirmation/order-confirmation.vue +++ b/src/layouts/order-confirmation/order-confirmation.vue @@ -318,7 +318,7 @@ export default { const contactInfoReqs = !!( contactInfo.firstName && contactInfo.lastName - && contactInfo.phoneNumber + && contactInfo.servicePhone && contactInfo.emailAddress ); diff --git a/src/layouts/payment-page/payment-page.spec.js b/src/layouts/payment-page/payment-page.spec.js index 2e2f62ef..661d656c 100644 --- a/src/layouts/payment-page/payment-page.spec.js +++ b/src/layouts/payment-page/payment-page.spec.js @@ -183,7 +183,7 @@ describe('payment-page.vue', () => { firstName: 'first', lastName: 'last', emailAddress: 'builddigitaltest@safelite.com', - phoneNumber: '555-555-5555' + servicePhone: '555-555-5555' }, damage: { isRepair: false, diff --git a/src/layouts/payment-page/payment-page.vue b/src/layouts/payment-page/payment-page.vue index d8b6d3b5..2642ccca 100644 --- a/src/layouts/payment-page/payment-page.vue +++ b/src/layouts/payment-page/payment-page.vue @@ -500,7 +500,7 @@ export default { zipCode: this.getZipCode(), firstName: useMainStore().order.contactInfo.firstName, lastName: useMainStore().order.contactInfo.lastName, - phoneNumber: useMainStore().order.contactInfo.phoneNumber, + phoneNumber: useMainStore().order.contactInfo.servicePhone, ctu: useMainStore().order.serviceLocation.zipCodeCtu, referralCorrelationId: useMainStore().order.referralCorrelationId, workOrderNumber: this.getWorkOrderNumber(), @@ -597,7 +597,7 @@ export default { const contactInfoReqs = !!( contactInfo.firstName && contactInfo.lastName - && contactInfo.phoneNumber + && contactInfo.servicePhone && contactInfo.emailAddress ); diff --git a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.spec.js b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.spec.js index e814af3d..9c579dbc 100644 --- a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.spec.js +++ b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.spec.js @@ -35,14 +35,14 @@ describe('contact-details-drawer', () => { const firstName = 'Frederick'; const lastName = 'Taylor'; const emailAddress = 'fred.tay@gmail.com'; - const phoneNumber = '606-009-2943'; + const servicePhone = '606-009-2943'; const mainInitialState = { order: { contactInfo: { firstName, lastName, emailAddress, - phoneNumber + servicePhone } } }; @@ -81,7 +81,7 @@ describe('contact-details-drawer', () => { firstName: 'Frederick', lastName: 'Taylor', emailAddress: 'fred.tay@gmail.com', - phoneNumber: '606-009-2943' + servicePhone: '606-009-2943' } } }; @@ -96,7 +96,9 @@ describe('contact-details-drawer', () => { // Assert expect(wrapper.emitted()['update-contact-details']).toBeTruthy(); expect(useMainStore().updateContactInfo).toBeCalledTimes(1); - expect(useMainStore().updateContactInfo).toBeCalledWith({ firstName, lastName, emailAddress, phoneNumber }); + expect(useMainStore().updateContactInfo).toBeCalledWith({ firstName, lastName, emailAddress }); + expect(useMainStore().updatePhoneNumbers).toBeCalledTimes(1); + expect(useMainStore().updatePhoneNumbers).toBeCalledWith({ home: phoneNumber, service: phoneNumber }); } ); }); diff --git a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue index 5f1b0b6f..334ba86a 100644 --- a/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue +++ b/src/layouts/tpa-submit/contact-details-drawer/contact-details-drawer.vue @@ -67,13 +67,13 @@ export default { const { firstName, lastName, emailAddress, - phoneNumber } = useMainStore().contactInfo; + servicePhone } = useMainStore().contactInfo; return { isModalOpened: false, firstName, lastName, emailAddress, - phoneNumber, + phoneNumber: servicePhone, widget: { title: 'ContactDetailsDrawerHeaderWidget', firstNameQuestion: 'FirstNameQuestionWidget', @@ -119,21 +119,24 @@ export default { const contactInfo = { firstName: this.firstName, lastName: this.lastName, - emailAddress: this.emailAddress, - phoneNumber: this.phoneNumber + emailAddress: this.emailAddress }; useMainStore().updateContactInfo(contactInfo); + useMainStore().updatePhoneNumbers({ + home: this.phoneNumber, + service: this.phoneNumber + }); this.$emit('update-contact-details'); }, resetFormValues() { const { firstName, lastName, emailAddress, - phoneNumber } = useMainStore().contactInfo; + servicePhone } = useMainStore().contactInfo; this.firstName = firstName; this.lastName = lastName; this.emailAddress = emailAddress; - this.phoneNumber = phoneNumber; + this.phoneNumber = servicePhone; }, openModal() { this.modal.openModal(); diff --git a/src/layouts/tpa-submit/tpa-submit.spec.js b/src/layouts/tpa-submit/tpa-submit.spec.js index aaadc048..d3bece6b 100644 --- a/src/layouts/tpa-submit/tpa-submit.spec.js +++ b/src/layouts/tpa-submit/tpa-submit.spec.js @@ -499,14 +499,14 @@ describe('tpa-submit', () => { const firstName = 'Jones'; const lastName = 'Eddison'; const emailAddress = 'myname@gmail.com'; - const phoneNumber = '0001112222'; + const servicePhone = '0001112222'; const initialStore = { order: { contactInfo: { firstName, lastName, emailAddress, - phoneNumber + servicePhone } } }; @@ -514,7 +514,7 @@ describe('tpa-submit', () => { const expectedLine1 = 'Jones Eddison'; const expectedLine2 = emailAddress; const expectedLine3 = 'some value returned'; - toDisplayPhoneNumber.mockImplementation((number) => (number === phoneNumber ? expectedLine3 : '')); + toDisplayPhoneNumber.mockImplementation((number) => (number === servicePhone ? expectedLine3 : '')); const contactInfoSectionIndex = 3; // Act @@ -530,7 +530,7 @@ describe('tpa-submit', () => { expect(contactInfoSection.lines[0]).toBe(expectedLine1); expect(contactInfoSection.lines[1]).toBe(expectedLine2); expect(contactInfoSection.lines[2]).toBe(expectedLine3); - expect(toDisplayPhoneNumber).toHaveBeenCalledWith(phoneNumber); + expect(toDisplayPhoneNumber).toHaveBeenCalledWith(servicePhone); }); }); describe('computed', () => { diff --git a/src/layouts/tpa-submit/tpa-submit.vue b/src/layouts/tpa-submit/tpa-submit.vue index 590a4645..fda79826 100644 --- a/src/layouts/tpa-submit/tpa-submit.vue +++ b/src/layouts/tpa-submit/tpa-submit.vue @@ -236,11 +236,11 @@ export default { return [toTitleCase(this.companyName ?? ''), displayAddress, displayPhoneNumber]; }, getContactInfoLines() { - const { firstName, lastName, emailAddress, phoneNumber } = useMainStore().contactInfo; + const { firstName, lastName, emailAddress, servicePhone } = useMainStore().contactInfo; return [ `${firstName} ${lastName}`, emailAddress ?? '', - toDisplayPhoneNumber(phoneNumber) + toDisplayPhoneNumber(servicePhone) ]; } }, diff --git a/src/store/index.js b/src/store/index.js index e4e129ec..c3728ae3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -23,7 +23,7 @@ import { } from '@/helpers/policy-vehicle-helper'; import partTypeStrings from '@/constants/part-type-strings'; import bailoutMessage from '@/constants/bailoutMessage'; -import bailoutCode from "@/constants/bailoutCode"; +import bailoutCode from '@/constants/bailoutCode'; const storeId = 'main'; @@ -119,8 +119,7 @@ export const getDefaultState = () => ({ }, firstName: null, lastName: null, - emailAddress: null, - phoneNumber: null + emailAddress: null }, serviceLocation: { address: null, @@ -182,7 +181,9 @@ export const getDefaultState = () => ({ firstName: null, lastName: null, emailAddress: null, - phoneNumber: null, + homePhone: null, + alternativePhone: null, + servicePhone: null, requestTextUpdates: false, notesForTechnician: '' }, @@ -308,7 +309,9 @@ export const useMainStore = defineStore({ firstName: s.order.contactInfo.firstName ?? s.order.customer.firstName, lastName: s.order.contactInfo.lastName ?? s.order.customer.lastName, emailAddress: s.order.contactInfo.emailAddress ?? s.order.customer.emailAddress, - phoneNumber: s.order.contactInfo.phoneNumber ?? s.order.customer.phoneNumber, + homePhone: s.order.contactInfo.homePhone, + alternativePhone: s.order.contactInfo.alternativePhone, + servicePhone: s.order.contactInfo.servicePhone, requestTextUpdates: s.order.contactInfo.requestTextUpdates ?? false, notesForTechnician: s.order.contactInfo.notesForTechnician }), @@ -554,7 +557,7 @@ export const useMainStore = defineStore({ country: 'US' // TODO set from store }, homePhone: { - number: this.order.customer.phoneNumber?.replaceAll(nonNumberCharRegex, '') ?? '' + number: this.order.customerInfo?.homePhone?.replaceAll(nonNumberCharRegex, '') ?? '' } }, driver: { @@ -1204,7 +1207,7 @@ export const useMainStore = defineStore({ policyHolder: { policyFirstName: customer.firstName, policyLastName: customer.lastName, - policyPhoneNumber: customer.phoneNumber, + policyPhoneNumber: contactInfo.servicePhone, policyEmail: customer.emailAddress, policyState: customer.address.state }, @@ -1228,8 +1231,10 @@ export const useMainStore = defineStore({ emailAddress: contactInfo.emailAddress || customer.emailAddress, firstName: contactInfo.firstName || customer.firstName, lastName: contactInfo.lastName || customer.lastName, - phoneNumber: contactInfo.phoneNumber, - optInSms: contactInfo.requestTextUpdates ?? false + homePhone: contactInfo.homePhone, + servicePhone: contactInfo.servicePhone, + alternativePhone: contactInfo.alternativePhone, + isSmsOptIn: contactInfo.requestTextUpdates ?? false }, lineItems: { glassParts: lineItems.glassParts, @@ -1325,7 +1330,6 @@ export const useMainStore = defineStore({ order.customer.emailAddress = data.customer?.emailAddress; order.customer.firstName = data.customer?.firstName; order.customer.lastName = data.customer?.lastName; - order.customer.phoneNumber = data?.customer?.phoneNumber; order.customer.address.streetAddress = data.customer?.address?.streetAddress; order.customer.address.streetAddress2 = data.customer?.address?.streetAddress2; @@ -1336,7 +1340,8 @@ export const useMainStore = defineStore({ order.contactInfo.firstName = data?.customer?.firstName; order.contactInfo.lastName = data?.customer?.lastName; order.contactInfo.emailAddress = data?.customer?.emailAddress; - order.contactInfo.phoneNumber = data?.customer?.phoneNumber; + order.contactInfo.homePhone = data?.customer?.phoneNumber; + order.contactInfo.servicephone = data?.customer?.phoneNumber; order.contactInfo.requestTextUpdates = data?.customer?.isSmsOptIn; order.payment.insuranceCoverage.isVerified = data?.payment?.insuranceCoverage?.isVerified; @@ -1775,8 +1780,11 @@ export const useMainStore = defineStore({ this.order.policy.damageState = welcomePageModel?.damageState; this.order.policy.damageCity = welcomePageModel?.damageCity; this.order.policy.isDamageGlassOnly = welcomePageModel?.isDamageGlassOnly; - this.order.customer.phoneNumber = welcomePageModel?.phoneNumber; this.order.customer.emailAddress = welcomePageModel?.email; + this.updatePhoneNumbers({ + home: welcomePageModel?.phoneNumber, + service: welcomePageModel?.phoneNumber + }); }, updatePolicyHolderDetails(customerQuestions) { this.order.customer.address.streetAddress = customerQuestions.addressQuestions.streetAddress; @@ -2123,11 +2131,17 @@ export const useMainStore = defineStore({ this.order.contactInfo.firstName = contactInfo?.firstName ?? ''; this.order.contactInfo.lastName = contactInfo?.lastName ?? ''; this.order.contactInfo.emailAddress = contactInfo?.emailAddress ?? ''; - this.order.contactInfo.phoneNumber = contactInfo?.phoneNumber ?? ''; this.order.contactInfo.requestTextUpdates = contactInfo?.requestTextUpdates ?? false; this.order.contactInfo.notesForTechnician = contactInfo?.notesForTechnician ?? ''; }, + updatePhoneNumbers(phoneNumbers) { + const contact = this.order.contactInfo; + contact.homePhone = phoneNumbers.home !== undefined ? phoneNumbers.home : contact.homePhone; + contact.alternativePhone = phoneNumbers.alternative !== undefined ? phoneNumbers.alternative : contact.alternativePhone; + contact.servicePhone = phoneNumbers.service !== undefined ? phoneNumbers.service : contact.servicePhone; + }, + GetExperimentsByUser(userId) { return globalMethods.callHttpClient({ method: endpoints.GetExperimentsByUser.method, @@ -2279,8 +2293,11 @@ export const useMainStore = defineStore({ setBailoutContactInfo(contact) { this.order.customer.firstName = contact.firstName; this.order.customer.lastName = contact.lastName; - this.order.customer.phoneNumber = contact.phoneNumber; this.order.customer.emailAddress = contact.email; + this.updatePhoneNumbers({ + home: contact.phoneNumber, + service: contact.phoneNumber + }); this.pageData(issPageValues.BAILOUT_PAGE).submit = true; }, @@ -2311,7 +2328,6 @@ export const useMainStore = defineStore({ this.order.policy.damageCity = null; this.order.policy.damageState = null; this.order.policy.isITAC = false; - this.order.customer.phoneNumber = null; this.order.customer.emailAddress = null; this.order.customer.firstName = null; this.order.customer.lastName = null; diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 29c5c538..8c7382ff 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -478,7 +478,6 @@ describe('Store', () => { const firstName = getRandomString(4, 10); const lastName = getRandomString(5, 15); const emailAddress = false; - const phoneNumber = getRandomInt(1000000000, 9999999999); const requestTextUpdates = getRandomBoolean(); const notesForTechnician = getRandomString(50, 150); @@ -486,7 +485,6 @@ describe('Store', () => { store.updateContactInfo({ firstName, lastName, emailAddress, - phoneNumber, requestTextUpdates, notesForTechnician }); @@ -494,10 +492,27 @@ describe('Store', () => { expect(store.contactInfo.firstName).toEqual(firstName); expect(store.contactInfo.lastName).toEqual(lastName); expect(store.contactInfo.emailAddress).toEqual(emailAddress); - expect(store.contactInfo.phoneNumber).toEqual(phoneNumber); expect(store.contactInfo.requestTextUpdates).toEqual(requestTextUpdates); expect(store.contactInfo.notesForTechnician).toEqual(notesForTechnician); }); + it('updatePhoneNumbers updates phone info in store', () => { + // Arrange + const homePhone = getRandomInt(1000000000, 9999999999); + const servicePhone = getRandomInt(1000000000, 9999999999); + const altPhone = getRandomInt(1000000000, 9999999999); + + // Act + store.updatePhoneNumbers({ + home: homePhone, + service: servicePhone, + alternative: altPhone + }); + + // Assert + expect(store.contactInfo.homePhone).toEqual(homePhone); + expect(store.contactInfo.servicePhone).toEqual(servicePhone); + expect(store.contactInfo.alternativePhone).toEqual(altPhone); + }); it('All null values => contact info set in store to all nulls', () => { // Act store.updateContactInfo({}); @@ -506,7 +521,6 @@ describe('Store', () => { expect(store.contactInfo.firstName).toEqual(''); expect(store.contactInfo.lastName).toEqual(''); expect(store.contactInfo.emailAddress).toEqual(''); - expect(store.contactInfo.phoneNumber).toEqual(''); expect(store.contactInfo.requestTextUpdates).toEqual(false); expect(store.contactInfo.notesForTechnician).toEqual(''); }); @@ -666,8 +680,9 @@ describe('Store', () => { store.order.customer.firstName = customerFirstName; store.order.customer.lastName = customerLastName; store.order.customer.emailAddress = customerEmail; - store.order.customer.phoneNumber = customerPhoneNumber; store.order.customer.address.state = customerState; + store.order.contactInfo.homePhone = customerPhoneNumber; + store.order.contactInfo.servicePhone = customerPhoneNumber; store.order.policy.policyNumber = policyNumber; store.order.policy.policyZipCode = policyZipCode; store.order.policy.policyLookupSuccessful = policyLookupSuccessful; @@ -708,12 +723,16 @@ describe('Store', () => { const contactFirstName = getRandomString(6, 6); const contactLastName = getRandomString(6, 6); const contactEmail = getRandomString(6, 6); - const contactPhoneNumber = getRandomString(6, 6); + const contactHomePhone = getRandomString(6, 6); + const contactServicePhone = getRandomString(6, 6); + const contactAlternativePhone = getRandomString(6, 6); const requestTextUpdates = getRandomBoolean(); store.order.contactInfo.firstName = contactFirstName; store.order.contactInfo.lastName = contactLastName; store.order.contactInfo.emailAddress = contactEmail; - store.order.contactInfo.phoneNumber = contactPhoneNumber; + store.order.contactInfo.homePhone = contactHomePhone; + store.order.contactInfo.servicePhone = contactServicePhone; + store.order.contactInfo.alternativePhone = contactAlternativePhone; store.order.contactInfo.requestTextUpdates = requestTextUpdates; store.order.customer.address.streetAddress = streetAddress; store.order.customer.address.streetAddress2 = streetAddress2; @@ -740,8 +759,10 @@ describe('Store', () => { emailAddress: contactEmail, firstName: contactFirstName, lastName: contactLastName, - phoneNumber: contactPhoneNumber, - optInSms: requestTextUpdates + homePhone: contactHomePhone, + servicePhone: contactServicePhone, + alternativePhone: contactAlternativePhone, + isSmsOptIn: requestTextUpdates }) }) })); @@ -1122,7 +1143,7 @@ describe('Store', () => { expect(store.order.customer.firstName).toBe(customer.firstName); expect(store.order.customer.lastName).toBe(customer.lastName); expect(store.order.customer.emailAddress).toBe(customer.emailAddress); - expect(store.order.customer.phoneNumber).toBe(customer.phoneNumber); + expect(store.order.contactInfo.homePhone).toBe(customer.phoneNumber); }); it('sets expected remaining order data', async () => { // Arrange