commit
a4aaa6ec88
2 changed files with 12 additions and 4 deletions
|
|
@ -1,13 +1,16 @@
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
|
import store from "@/store";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import { saveOrder } from "@/helpers/heritage-integration/order-helper.js";
|
import { saveOrder } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
async navigateForwardWithSingleCarMatch() {
|
async navigateForwardWithSingleCarMatch() {
|
||||||
// We want to save the order before calling getPartsOrQuestions because that call is lengthy
|
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
|
||||||
saveOrder();
|
if (!store.getters.applicationUser.savedSessionId) {
|
||||||
|
saveOrder();
|
||||||
|
}
|
||||||
|
|
||||||
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
||||||
const partsOrQuestions = result.data.partsOrQuestions;
|
const partsOrQuestions = result.data.partsOrQuestions;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,12 @@ function setupMocks({ partsOrQuestions = [] }) {
|
||||||
navigate: jest.fn(), navigateWithSaving: jest.fn(), navigateWithoutSaving: jest.fn(),
|
navigate: jest.fn(), navigateWithSaving: jest.fn(), navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
store: {
|
store: {
|
||||||
commit: jest.fn()
|
commit: jest.fn(),
|
||||||
|
getters: {
|
||||||
|
applicationUser: {
|
||||||
|
savedSessionId: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue