Tech review changes

This commit is contained in:
Leah Schumann 2023-06-09 14:45:04 -04:00
parent 86f0f0fb94
commit 716fbe3603
9 changed files with 10 additions and 6 deletions

View file

@ -79,6 +79,7 @@ const storeActions = {
SAVE_PAYMENT_TYPE: "savePaymentType",
SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber",
SAVE_SUPPORTING_ITEMS: "saveSupportingItems",
SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION: "saveSupportingItemsAndResetServiceLocation",
SAVE_VAPS: "saveVaps",
};

View file

@ -272,7 +272,7 @@ export default {
const resultMap = await settleAllPromises(promiseResultMap);
this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS,
this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION,
resultMap.supportingItems,
false
);

View file

@ -109,7 +109,6 @@ store.getters = {
damage: baseStoreGettersDamage,
order: {},
};
//store.commit = jest.fn();
store.dispatch = jest.fn();
afterEach(() => {

View file

@ -207,7 +207,7 @@ export default {
}
this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS,
this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION,
this.supportingItems,
false
);

View file

@ -66,7 +66,7 @@ import addressQuestions from "@/layouts/address-lookup/customer-questions/addres
import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question";
// Helpers
import { deepClone } from "@/layouts/service-location/helpers/object-helper/object-helper";
import { deepClone } from "@/helpers/object-helper";
import {
getPricedMobileFeePart,
getServiceabilityDetails,

View file

@ -330,7 +330,7 @@ export default {
storeActions.GET_SUPPORTING_ITEMS
);
this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS,
this.storeActions.SAVE_SUPPORTING_ITEMS_AND_RESET_SERVICE_LOCATION,
supportingItems.data,
false
);

View file

@ -10,7 +10,7 @@ import { experimentTriggers } from "@/constants/experiments";
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js";
import { deepEqual } from "@/layouts/service-location/helpers/object-helper/object-helper.js";
import { deepEqual } from "@/helpers/object-helper";
import { AppointmentTypeStrings, PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
// Export State
@ -1776,6 +1776,10 @@ export const actions = {
},
saveSupportingItems(context, supportingItems) {
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
},
saveSupportingItemsAndResetServiceLocation(context, supportingItems) {
if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) {
context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE);
context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);