Merge pull request #1291 from Safelite/feature/CSR-1564

Feature/csr 1564
This commit is contained in:
CarlNation 2023-08-03 10:57:28 -04:00 committed by GitHub
commit ced3177eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 22 deletions

View file

@ -51,7 +51,7 @@ describe("schedule.vue", () => {
const { wrapper } = setupMocks({ const { wrapper } = setupMocks({
customMountOptions: { customMountOptions: {
router: { router: {
navigateWithoutSaving: jest.fn(), navigateWithSaving: jest.fn(),
}, },
route: { schedule }, route: { schedule },
}, },
@ -67,7 +67,7 @@ describe("schedule.vue", () => {
await wrapper.vm.forwardButtonAction(); await wrapper.vm.forwardButtonAction();
//Assert //Assert
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalled(); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled();
}); });
test("should pass arePagePrerequisitesValid with a mobile order and no providerNumber", () => { test("should pass arePagePrerequisitesValid with a mobile order and no providerNumber", () => {
//Arrange //Arrange

View file

@ -402,11 +402,7 @@ export default {
this.updateSupportingItems(); this.updateSupportingItems();
this.dispatchStoreAction(this.storeActions.SAVE_SCHEDULE, this.selectedTimeSlot, false); this.dispatchStoreAction(this.storeActions.SAVE_SCHEDULE, this.selectedTimeSlot, false);
//Temporary, still need to determine what needs to be saved before continuing. this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_FORWARD,
this.$route
);
}, },
updateSupportingItems() { updateSupportingItems() {
const supportingItems = this.getSupportingItems(); const supportingItems = this.getSupportingItems();

View file

@ -244,12 +244,8 @@ export const mutations = {
}, },
updateRegistration(state, registrationInfo) { updateRegistration(state, registrationInfo) {
state.order.vehicle.registration.licensePlate = registrationInfo?.licensePlate; state.order.vehicle.registration.licensePlate = registrationInfo?.licensePlate;
state.order.vehicle.registration.address = registrationInfo?.address; state.order.customer.firstName = registrationInfo?.firstName;
state.order.vehicle.registration.city = registrationInfo?.city; state.order.customer.lastName = registrationInfo?.lastName;
state.order.vehicle.registration.state = registrationInfo?.state;
state.order.vehicle.registration.zipCode = registrationInfo?.zipCode;
state.order.vehicle.registration.firstName = registrationInfo?.firstName;
state.order.vehicle.registration.lastName = registrationInfo?.lastName;
}, },
updateServiceZip(state, serviceZipInfo) { updateServiceZip(state, serviceZipInfo) {
state.order.serviceLocation.state = serviceZipInfo.state; state.order.serviceLocation.state = serviceZipInfo.state;
@ -437,15 +433,6 @@ export const mutations = {
imageUrl: sessionInformation.order.vehicle?.imageUrl, imageUrl: sessionInformation.order.vehicle?.imageUrl,
imageVifNumber: sessionInformation.order.vehicle?.imageVifNumber, imageVifNumber: sessionInformation.order.vehicle?.imageVifNumber,
imageColor: sessionInformation.order.vehicle?.imageVifColor, imageColor: sessionInformation.order.vehicle?.imageVifColor,
registration: {
firstName: sessionInformation.order.vehicle.registration.firstName,
lastName: sessionInformation.order.vehicle.registration.lastName,
address: sessionInformation.order.vehicle.registration.streetAddress,
city: sessionInformation.order.vehicle.registration.city,
state: sessionInformation.order.vehicle.registration.state,
zipCode: sessionInformation.order.vehicle.registration.zipCode,
licensePlate: sessionInformation.order.vehicle.registration.licensePlateNumber,
},
}); });
state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace; state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace;
@ -494,6 +481,7 @@ export const mutations = {
sessionInformation.order.serviceLocation.provider?.address?.zipCode; sessionInformation.order.serviceLocation.provider?.address?.zipCode;
state.order.serviceLocation.provider.address.zipCodeCtu = state.order.serviceLocation.provider.address.zipCodeCtu =
sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu; sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu;
state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes;
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance; state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
state.order.payment.insuranceCoverage.isVerified = state.order.payment.insuranceCoverage.isVerified =
@ -502,6 +490,11 @@ export const mutations = {
sessionInformation?.insuranceInfo?.coverageStatus; sessionInformation?.insuranceInfo?.coverageStatus;
state.order.customer.emailAddress = sessionInformation.order.customer.emailAddress; state.order.customer.emailAddress = sessionInformation.order.customer.emailAddress;
state.order.customer.firstName = sessionInformation.order.customer.firstName;
state.order.customer.lastName = sessionInformation.order.customer.lastName;
state.order.customer.phoneNumber = sessionInformation.order.customer.phoneNumber;
state.order.customer.isSmsOptin = sessionInformation.order.customer.isSmsOptin;
state.order.existingPromoCode = sessionInformation.order.existingPromoCode; state.order.existingPromoCode = sessionInformation.order.existingPromoCode;
state.applicationUser.experiments = sessionInformation.applicationUser.experiments; state.applicationUser.experiments = sessionInformation.applicationUser.experiments;
state.applicationUser.crmCustomerId = sessionInformation.applicationUser.crmCustomerId; state.applicationUser.crmCustomerId = sessionInformation.applicationUser.crmCustomerId;
@ -1422,6 +1415,10 @@ export const actions = {
}, },
customer: { customer: {
emailAddress: order.customer.emailAddress, emailAddress: order.customer.emailAddress,
firstName: order.customer.firstName,
lastName: order.customer.lastName,
isSmsOptin: order.customer.isSmsOptin,
phoneNumber: order.customer.phoneNumber,
}, },
damage: { damage: {
numberOfChips: damage.numberOfChips, numberOfChips: damage.numberOfChips,
@ -1464,6 +1461,7 @@ export const actions = {
zipCodeCtu: order.serviceLocation.provider?.address?.zipCodeCtu, zipCodeCtu: order.serviceLocation.provider?.address?.zipCodeCtu,
}, },
}, },
techNotes: order.serviceLocation.techNotes,
}, },
schedule: { schedule: {
date: order.schedule?.date, date: order.schedule?.date,