diff --git a/src/layouts/contact-details/contact-details.spec.js b/src/layouts/contact-details/contact-details.spec.js index 5b5131a8..8a4d4d7b 100644 --- a/src/layouts/contact-details/contact-details.spec.js +++ b/src/layouts/contact-details/contact-details.spec.js @@ -330,6 +330,30 @@ describe('contactDetails.vue', () => { navigate: jest.fn() } }); + const provider = { + address: { + city: getRandomString(4, 20), + state: getRandomString(2, 2), + streetAddress: getRandomString(10, 50), + zipCode: getRandomInt(10000, 99999).toString(), + zipCodeCtu: getRandomInt(10000, 99999).toString() + }, + companyName: getRandomString(5, 15), + phoneNumber: getRandomInt(1000000000, 9999999999).toString(), + providerNumber: getRandomInt(100000, 999999).toString() + } + const mainInitialState = { + order: { + serviceLocation: { + provider + } + } + }; + mountOptions.global.plugins = [createTestingPinia({ + initialState: { + main: mainInitialState + } + })]; const wrapper = shallowMount(contactDetails, mountOptions); const address = getRandomString(10, 50); const address2 = getRandomString(0, 50); @@ -354,7 +378,8 @@ describe('contactDetails.vue', () => { address, address2, city, - isVehicleProtected + isVehicleProtected, + provider }); }); diff --git a/src/layouts/contact-details/contact-details.vue b/src/layouts/contact-details/contact-details.vue index 5a84b8f3..b864ff19 100644 --- a/src/layouts/contact-details/contact-details.vue +++ b/src/layouts/contact-details/contact-details.vue @@ -245,11 +245,14 @@ export default { }; useMainStore().updateContactInfo(contactInfo); + const provider = useMainStore().serviceLocation.provider; + useMainStore().updateServiceLocation({ address: this.address, address2: this.address2, city: this.city, - isVehicleProtected: this.isVehicleProtected || 'false' + isVehicleProtected: this.isVehicleProtected || 'false', + provider }); this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route); diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue index 0af2fc9e..601a1e5d 100644 --- a/src/layouts/schedule-page/service-location/service-location.vue +++ b/src/layouts/schedule-page/service-location/service-location.vue @@ -372,7 +372,7 @@ export default { }; } - this.mainStore.saveServiceLocation({ + this.mainStore.updateServiceLocation({ state: this.state, zipCode: this.zipCode, zipCodeCtu: this.zipCodeCtu, diff --git a/src/layouts/schedule-page/service-location/shop-address/shop-address.vue b/src/layouts/schedule-page/service-location/shop-address/shop-address.vue index f2fca788..c4ce8b47 100644 --- a/src/layouts/schedule-page/service-location/shop-address/shop-address.vue +++ b/src/layouts/schedule-page/service-location/shop-address/shop-address.vue @@ -68,7 +68,7 @@ groupName="chooseShop" textPosition="text-start" isRequired - validationRules="option-required" /> + validationRules="provider-required" /> {{ serviceZipPrompt }} @@ -116,7 +116,7 @@ import errorMessages from '@/constants/error-messages'; import { defineRule } from 'vee-validate'; import { required } from '@/helpers/validation-rules'; -defineRule('option-required', required(errorMessages.PROVIDER_REQUIRED)); +defineRule('provider-required', required(errorMessages.PROVIDER_REQUIRED)); const SERVICE_ZIP_QUESTION_REF_NAME = 'serviceZipCodeQuestion'; diff --git a/src/store/index.js b/src/store/index.js index 32ee3b69..cd155ef2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1842,7 +1842,7 @@ export const useMainStore = defineStore({ this.order.serviceLocation.zipCodeCtu = serviceLocationInfo.zipCodeCtu ?? this.order.serviceLocation.zipCodeCtu; this.order.serviceLocation.appointmentType = serviceLocationInfo.appointmentType ?? this.order.serviceLocation.appointmentType; this.order.serviceLocation.isVehicleProtected = serviceLocationInfo.isVehicleProtected ?? this.order.serviceLocation.isVehicleProtected; - this.updateServiceLocationProvider(serviceLocationInfo.provider) + this.updateServiceLocationProvider(serviceLocationInfo.provider); this.order.serviceLocation.tpaSearchRadius = serviceLocationInfo.tpaSearchRadius; }, updateAppointmentType(appointmentType) {