Fixed unit tests
This commit is contained in:
parent
239faec2f7
commit
86f0f0fb94
4 changed files with 9 additions and 5 deletions
|
|
@ -109,7 +109,8 @@ store.getters = {
|
||||||
damage: baseStoreGettersDamage,
|
damage: baseStoreGettersDamage,
|
||||||
order: {},
|
order: {},
|
||||||
};
|
};
|
||||||
store.commit = jest.fn();
|
//store.commit = jest.fn();
|
||||||
|
store.dispatch = jest.fn();
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
// reset store after each test
|
// reset store after each test
|
||||||
|
|
|
||||||
|
|
@ -481,7 +481,7 @@ describe("vehicle-parts.vue", () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
wrapper.vm.$store.commit = jest.fn();
|
wrapper.vm.dispatchStoreAction = jest.fn();
|
||||||
|
|
||||||
wrapper.setData({
|
wrapper.setData({
|
||||||
selectedGlassParts: { "Rear-Stationary": { partNumber: "DB12209GTYN" } },
|
selectedGlassParts: { "Rear-Stationary": { partNumber: "DB12209GTYN" } },
|
||||||
|
|
@ -498,7 +498,7 @@ describe("vehicle-parts.vue", () => {
|
||||||
await wrapper.vm.forwardButtonAction();
|
await wrapper.vm.forwardButtonAction();
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(wrapper.vm.$store.commit).toHaveBeenCalled();
|
expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalled();
|
||||||
|
|
||||||
// TODO KO UNCOMMENT FOR QUOTE PAGES RELEASE
|
// TODO KO UNCOMMENT FOR QUOTE PAGES RELEASE
|
||||||
// expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith(
|
// expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith(
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ export default {
|
||||||
const collectedGlassParts = this.reducedGlassPartsArray(partsOrQuestions);
|
const collectedGlassParts = this.reducedGlassPartsArray(partsOrQuestions);
|
||||||
|
|
||||||
// save to store lineItems.glassParts
|
// save to store lineItems.glassParts
|
||||||
self.$store.dispatch(storeActions.SAVE_GLASS_PARTS, collectedGlassParts);
|
self.dispatchStoreAction(storeActions.SAVE_GLASS_PARTS, collectedGlassParts, false);
|
||||||
|
|
||||||
const payment = store.getters.payment;
|
const payment = store.getters.payment;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -961,7 +961,10 @@ describe("Actions", () => {
|
||||||
|
|
||||||
it("saveGlassParts, should call mutation", () => {
|
it("saveGlassParts, should call mutation", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const context = state;
|
const context = {
|
||||||
|
state: state,
|
||||||
|
};
|
||||||
|
|
||||||
const commit = jest.fn();
|
const commit = jest.fn();
|
||||||
|
|
||||||
context.commit = commit;
|
context.commit = commit;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue