Merge pull request #1170 from Safelite/feature/CSR-1148-ch
Feature/csr 1148 ch
This commit is contained in:
commit
831b579df1
3 changed files with 425 additions and 6 deletions
|
|
@ -54,6 +54,7 @@ const storeActions = {
|
||||||
RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies",
|
RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies",
|
||||||
RESET_REGISTRATION_STATE_AND_DEPENDENCIES: "resetRegistrationAndDependencies",
|
RESET_REGISTRATION_STATE_AND_DEPENDENCIES: "resetRegistrationAndDependencies",
|
||||||
RESET_PARTS_STATE_AND_DEPENDENCIES: "resetPartsAndDependencies",
|
RESET_PARTS_STATE_AND_DEPENDENCIES: "resetPartsAndDependencies",
|
||||||
|
RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES: "resetServiceLocationAndDependencies",
|
||||||
RESET_STATE: "resetState",
|
RESET_STATE: "resetState",
|
||||||
|
|
||||||
// SAVE COMPONENT STATE
|
// SAVE COMPONENT STATE
|
||||||
|
|
|
||||||
|
|
@ -726,6 +726,15 @@ export const actions = {
|
||||||
resetPartsAndDependencies(context) {
|
resetPartsAndDependencies(context) {
|
||||||
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
context.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, null);
|
||||||
|
|
||||||
|
context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
|
},
|
||||||
|
|
||||||
|
resetServiceLocationAndDependencies(context) {
|
||||||
|
context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE);
|
||||||
|
context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);
|
||||||
|
|
||||||
|
context.commit(storeMutations.RESET_SCHEDULE);
|
||||||
},
|
},
|
||||||
|
|
||||||
resetState(context) {
|
resetState(context) {
|
||||||
|
|
@ -1777,8 +1786,7 @@ export const actions = {
|
||||||
|
|
||||||
saveSupportingItems(context, supportingItems) {
|
saveSupportingItems(context, supportingItems) {
|
||||||
if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) {
|
if (!deepEqual(supportingItems, context.state.order.lineItems.supportingItems)) {
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE);
|
context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
|
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
|
||||||
|
|
@ -1854,8 +1862,8 @@ export const actions = {
|
||||||
context.state.order.serviceLocation &&
|
context.state.order.serviceLocation &&
|
||||||
serviceZipCodeInfo.zipCode !== context.state.order.serviceLocation.zipCode
|
serviceZipCodeInfo.zipCode !== context.state.order.serviceLocation.zipCode
|
||||||
) {
|
) {
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE);
|
context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);
|
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_MOBILE_ADDRESS);
|
context.commit(storeMutations.RESET_SERVICE_LOCATION_MOBILE_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1863,6 +1871,20 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
saveServiceLocation(context, serviceLocationInfo) {
|
saveServiceLocation(context, serviceLocationInfo) {
|
||||||
|
if (context.state.order.serviceLocation) {
|
||||||
|
if (
|
||||||
|
serviceLocationInfo.zipCode !== context.state.order.serviceLocation.zipCode ||
|
||||||
|
!deepEqual(
|
||||||
|
serviceLocationInfo.provider,
|
||||||
|
context.state.order.serviceLocation.provider
|
||||||
|
) ||
|
||||||
|
serviceLocationInfo.appointmentType !==
|
||||||
|
context.state.order.serviceLocation.appointmentType
|
||||||
|
) {
|
||||||
|
context.commit(storeMutations.RESET_SCHEDULE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
context.commit(storeMutations.UPDATE_SERVICE_LOCATION, serviceLocationInfo);
|
context.commit(storeMutations.UPDATE_SERVICE_LOCATION, serviceLocationInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1885,8 +1907,7 @@ export const actions = {
|
||||||
|
|
||||||
saveGlassParts(context, parts) {
|
saveGlassParts(context, parts) {
|
||||||
if (!deepEqual(parts, context.state.order.lineItems.glassParts)) {
|
if (!deepEqual(parts, context.state.order.lineItems.glassParts)) {
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_APPOINTMENT_TYPE);
|
context.dispatch(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
context.commit(storeMutations.RESET_SERVICE_LOCATION_PROVIDER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, parts);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, parts);
|
||||||
|
|
|
||||||
|
|
@ -575,13 +575,16 @@ describe("Actions", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = state;
|
||||||
const commit = jest.fn();
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
context.commit = commit;
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await actions.resetPartsAndDependencies(context);
|
await actions.resetPartsAndDependencies(context);
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.RESET_GLASS_PARTS_STATE);
|
expect(commit).toBeCalledWith(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
|
expect(dispatch).toBeCalledWith(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resetState action", async () => {
|
it("resetState action", async () => {
|
||||||
|
|
@ -933,6 +936,90 @@ describe("Actions", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("saveServiceZipCodeInfo, should call mutation and save zip code to state", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = state;
|
||||||
|
const commit = jest.fn();
|
||||||
|
context.commit = commit;
|
||||||
|
|
||||||
|
const serviceZipCodeInfo = {
|
||||||
|
zipCode: "43212",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceLocation(context, serviceZipCodeInfo);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).toBeCalledWith(storeMutations.UPDATE_SERVICE_LOCATION, serviceZipCodeInfo);
|
||||||
|
expect(state.order.serviceLocation.zipCode).toEqual("43212");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveServiceZipCodeInfo, should reset if zip code is different", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
zipCode: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceZipCodeInfo = {
|
||||||
|
zipCode: "43202",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceZipCodeInfo(context, serviceZipCodeInfo);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(dispatch).toHaveBeenCalledWith(
|
||||||
|
storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES
|
||||||
|
);
|
||||||
|
expect(commit).toHaveBeenCalledWith(storeMutations.RESET_SERVICE_LOCATION_MOBILE_ADDRESS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveServiceZipCodeInfo, should not reset if zip code is the same", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
zipCode: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceZipCodeInfo = {
|
||||||
|
zipCode: "43212",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceZipCodeInfo(context, serviceZipCodeInfo);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(dispatch).not.toHaveBeenCalledWith(
|
||||||
|
storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES
|
||||||
|
);
|
||||||
|
expect(commit).not.toHaveBeenCalledWith(
|
||||||
|
storeMutations.RESET_SERVICE_LOCATION_MOBILE_ADDRESS
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("saveServiceLocation, should call mutation and save service address to state", () => {
|
it("saveServiceLocation, should call mutation and save service address to state", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = state;
|
||||||
|
|
@ -959,6 +1046,242 @@ describe("Actions", () => {
|
||||||
expect(state.order.serviceLocation.zipCodeCtu).toEqual("01820");
|
expect(state.order.serviceLocation.zipCodeCtu).toEqual("01820");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("saveServiceLocation, should reset if zipcode is different", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceLocation = {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43202",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceLocation(context, serviceLocation);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).toHaveBeenCalledWith(storeMutations.RESET_SCHEDULE);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveServiceLocation, should reset if provider is different", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceLocation = {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "22222",
|
||||||
|
address: {
|
||||||
|
streetAddress: "321 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceLocation(context, serviceLocation);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).toHaveBeenCalledWith(storeMutations.RESET_SCHEDULE);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveServiceLocation, should reset if appointment type is different", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceLocation = {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Inshop",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceLocation(context, serviceLocation);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).toHaveBeenCalledWith(storeMutations.RESET_SCHEDULE);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveServiceLocation, should not reset if parameters are the same", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
serviceLocation: {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
const serviceLocation = {
|
||||||
|
address: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
zipCode: "43212",
|
||||||
|
state: "OH",
|
||||||
|
zipCodeCtu: "01820",
|
||||||
|
appointmentType: "Mobile",
|
||||||
|
isVehicleProtected: true,
|
||||||
|
provider: {
|
||||||
|
providerNumber: "11111",
|
||||||
|
address: {
|
||||||
|
streetAddress: "123 Test Lane",
|
||||||
|
city: "Columbus",
|
||||||
|
state: "OH",
|
||||||
|
zip: "43212",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveServiceLocation(context, serviceLocation);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).not.toHaveBeenCalledWith(storeMutations.RESET_SCHEDULE);
|
||||||
|
});
|
||||||
|
|
||||||
it("saveGlassParts, should call mutation", () => {
|
it("saveGlassParts, should call mutation", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = {
|
const context = {
|
||||||
|
|
@ -966,14 +1289,88 @@ describe("Actions", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const commit = jest.fn();
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
context.commit = commit;
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
actions.saveGlassParts(context, { glassParts: {} });
|
actions.saveGlassParts(context, { glassParts: {} });
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(commit).toBeCalledWith(storeMutations.UPDATE_GLASS_PARTS, { glassParts: {} });
|
expect(commit).toBeCalledWith(storeMutations.UPDATE_GLASS_PARTS, { glassParts: {} });
|
||||||
|
expect(dispatch).toBeCalledWith(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveSupportingItems, should call mutations", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: state,
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveSupportingItems(context, []);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(commit).toBeCalledWith(storeMutations.UPDATE_SUPPORTING_ITEMS, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveSupportingItems, should call reset logic when value is new", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
lineItems: {
|
||||||
|
supportingItems: ["TestValue1", "TestValue2"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveSupportingItems(context, ["TestValue3", "TestValue4", "TestValue5"]);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(dispatch).toBeCalledWith(storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("saveSupportingItems, should not call reset logic when value is the same", () => {
|
||||||
|
// Arrange
|
||||||
|
const context = {
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
lineItems: {
|
||||||
|
supportingItems: ["TestValue1", "TestValue2"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const commit = jest.fn();
|
||||||
|
const dispatch = jest.fn();
|
||||||
|
|
||||||
|
context.commit = commit;
|
||||||
|
context.dispatch = dispatch;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
actions.saveSupportingItems(context, ["TestValue1", "TestValue2"]);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(dispatch).not.toBeCalledWith(
|
||||||
|
storeActions.RESET_SERVICE_LOCATION_STATE_AND_DEPENDENCIES
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("clearVin, should call mutation", () => {
|
it("clearVin, should call mutation", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue