Merge pull request #688 from Safelite/feature/CSR-722

Feature/csr 722
This commit is contained in:
Leah Schumann 2022-08-22 16:56:52 -04:00 committed by GitHub
commit a4aaa6ec88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -1,12 +1,15 @@
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;

View file

@ -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
}
}
} }
}); });