Merge branch 'develop' into feature/CSR-659
This commit is contained in:
commit
cf29476668
8 changed files with 17 additions and 18 deletions
|
|
@ -14,7 +14,7 @@ const storeMutations = {
|
||||||
UPDATE_IS_REPAIR: "updateIsRepair",
|
UPDATE_IS_REPAIR: "updateIsRepair",
|
||||||
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
||||||
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
|
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
|
||||||
UPDATE_PARTS: "updateParts",
|
UPDATE_GLASS_PARTS: "updateGlassParts",
|
||||||
UPDATE_REGISTRATION_LICENSE_PLATE : "updateRegistrationLicensePlate",
|
UPDATE_REGISTRATION_LICENSE_PLATE : "updateRegistrationLicensePlate",
|
||||||
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
||||||
UPDATE_REGISTRATION_CITY: "updateRegistrationCity",
|
UPDATE_REGISTRATION_CITY: "updateRegistrationCity",
|
||||||
|
|
@ -40,7 +40,7 @@ const storeMutations = {
|
||||||
RESET_VEHICLE_STATE: "resetVehicleState",
|
RESET_VEHICLE_STATE: "resetVehicleState",
|
||||||
RESET_DAMAGE_STATE: "resetDamageState",
|
RESET_DAMAGE_STATE: "resetDamageState",
|
||||||
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
||||||
RESET_PARTS_STATE: "resetPartsState",
|
RESET_GLASS_PARTS_STATE: "resetGlassPartsState",
|
||||||
RESET_STATE: "resetState",
|
RESET_STATE: "resetState",
|
||||||
|
|
||||||
// OTHER MUTATIONS
|
// OTHER MUTATIONS
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ export default {
|
||||||
},
|
},
|
||||||
resetDependentState() {
|
resetDependentState() {
|
||||||
// Set
|
// Set
|
||||||
store.commit(storeMutations.UPDATE_PARTS, null);
|
store.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
|
|
||||||
// Invokes
|
// Invokes
|
||||||
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export default {
|
||||||
},
|
},
|
||||||
resetDependentState() {
|
resetDependentState() {
|
||||||
// Set
|
// Set
|
||||||
store.commit(storeMutations.UPDATE_PARTS, null);
|
store.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
|
|
||||||
// Invokes
|
// Invokes
|
||||||
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
store.dispatch(storeActions.RESET_PARTS_AND_DEPS);
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save parts to the store.
|
// Save parts to the store.
|
||||||
store.commit(storeMutations.UPDATE_PARTS, matchedParts);
|
store.commit(storeMutations.UPDATE_GLASS_PARTS, matchedParts);
|
||||||
|
|
||||||
// Navigate to the next page.
|
// Navigate to the next page.
|
||||||
this.$router.navigateAfterSave(
|
this.$router.navigateAfterSave(
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default {
|
||||||
this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, this.$route, {}, {}, result.data);
|
this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, this.$route, {}, {}, result.data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
store.commit(storeMutations.UPDATE_PARTS, result.data);
|
store.commit(storeMutations.UPDATE_GLASS_PARTS, result.data);
|
||||||
this.$refs.loadingModal.showModal();
|
this.$refs.loadingModal.showModal();
|
||||||
navigateAfterSaveToHeritageFunnel(this.$route);
|
navigateAfterSaveToHeritageFunnel(this.$route);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,7 @@ describe("vin-pages-mixin", () => {
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(store.commit).toHaveBeenCalledTimes(1);
|
expect(store.commit).toHaveBeenCalledTimes(1);
|
||||||
expect(store.commit).toHaveBeenCalledWith(storeMutations.UPDATE_PARTS, { partsOrQuestions })
|
expect(store.commit).toHaveBeenCalledWith(storeMutations.UPDATE_GLASS_PARTS, { partsOrQuestions })
|
||||||
expect(wrapper.vm.$refs.loadingModal.showModal).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.$refs.loadingModal.showModal).toHaveBeenCalledTimes(1);
|
||||||
expect(navigateAfterSaveToHeritageFunnel).toHaveBeenCalledTimes(1);
|
expect(navigateAfterSaveToHeritageFunnel).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ export const mutations = {
|
||||||
updateGlassToReplace(state, glassToReplace) {
|
updateGlassToReplace(state, glassToReplace) {
|
||||||
state.order.damage.glassToReplace = glassToReplace;
|
state.order.damage.glassToReplace = glassToReplace;
|
||||||
},
|
},
|
||||||
updateParts(state, partsData) {
|
updateGlassParts(state, partsData) {
|
||||||
state.order.lineItems.glassParts = partsData;
|
state.order.lineItems.glassParts = partsData;
|
||||||
},
|
},
|
||||||
updatePageData(state, pageData) {
|
updatePageData(state, pageData) {
|
||||||
|
|
@ -212,9 +212,8 @@ export const mutations = {
|
||||||
state.order.vehicle.registration.firstName = null;
|
state.order.vehicle.registration.firstName = null;
|
||||||
state.order.vehicle.registration.lastName = null;
|
state.order.vehicle.registration.lastName = null;
|
||||||
},
|
},
|
||||||
resetPartsState(state) {
|
resetGlassPartsState(state) {
|
||||||
state.order.lineItems.glassParts = null;
|
state.order.lineItems.glassParts = null;
|
||||||
state.order.lineItems.otherParts = null;
|
|
||||||
},
|
},
|
||||||
resetState(state) {
|
resetState(state) {
|
||||||
Object.assign(state, getDefaultState());
|
Object.assign(state, getDefaultState());
|
||||||
|
|
@ -400,14 +399,14 @@ export const actions = {
|
||||||
},
|
},
|
||||||
resetDamageAndDependencies(context) {
|
resetDamageAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_DAMAGE_STATE);
|
context.commit(storeMutations.RESET_DAMAGE_STATE);
|
||||||
context.commit(storeMutations.RESET_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
},
|
},
|
||||||
resetRegistrationAndDependencies(context) {
|
resetRegistrationAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_REGISTRATION_STATE);
|
context.commit(storeMutations.RESET_REGISTRATION_STATE);
|
||||||
context.commit(storeMutations.RESET_PARTS_STATE)
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE)
|
||||||
},
|
},
|
||||||
resetPartsAndDependencies(context) {
|
resetPartsAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
},
|
},
|
||||||
resetState(context) {
|
resetState(context) {
|
||||||
context.commit(storeMutations.RESET_STATE);
|
context.commit(storeMutations.RESET_STATE);
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ describe("Mutations", () => {
|
||||||
const storeState = state;
|
const storeState = state;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
mutations.updateParts(storeState, { 'Windshield-Single': 'PARTNUM101'});
|
mutations.updateGlassParts(storeState, { 'Windshield-Single': 'PARTNUM101'});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(storeState.order.lineItems.glassParts).toEqual({ 'Windshield-Single': 'PARTNUM101'});
|
expect(storeState.order.lineItems.glassParts).toEqual({ 'Windshield-Single': 'PARTNUM101'});
|
||||||
|
|
@ -446,7 +446,7 @@ describe("Actions", () => {
|
||||||
await actions.resetDamageAndDependencies(context)
|
await actions.resetDamageAndDependencies(context)
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_DAMAGE_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_DAMAGE_STATE);
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_PARTS_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -462,7 +462,7 @@ describe("Actions", () => {
|
||||||
await actions.resetRegistrationAndDependencies(context)
|
await actions.resetRegistrationAndDependencies(context)
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_REGISTRATION_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_REGISTRATION_STATE);
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_PARTS_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -477,7 +477,7 @@ describe("Actions", () => {
|
||||||
// Act
|
// Act
|
||||||
await actions.resetPartsAndDependencies(context)
|
await actions.resetPartsAndDependencies(context)
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_PARTS_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -747,7 +747,7 @@ describe("Getters", () => {
|
||||||
const storeState = state;
|
const storeState = state;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
mutations.updateParts(storeState, {"Rear-Stationary": 'PART101'});
|
mutations.updateGlassParts(storeState, {"Rear-Stationary": 'PART101'});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(getters.lineItems(storeState).glassParts).toEqual({"Rear-Stationary": 'PART101'});
|
expect(getters.lineItems(storeState).glassParts).toEqual({"Rear-Stationary": 'PART101'});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue