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,13 +1,16 @@
import { storeActions } from "@/constants/store-actions.js";
import store from "@/store";
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
import { saveOrder } from "@/helpers/heritage-integration/order-helper.js";
export default {
methods: {
async navigateForwardWithSingleCarMatch() {
// We want to save the order before calling getPartsOrQuestions because that call is lengthy
saveOrder();
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
if (!store.getters.applicationUser.savedSessionId) {
saveOrder();
}
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
const partsOrQuestions = result.data.partsOrQuestions;

View file

@ -50,7 +50,12 @@ function setupMocks({ partsOrQuestions = [] }) {
navigate: jest.fn(), navigateWithSaving: jest.fn(), navigateWithoutSaving: jest.fn(),
},
store: {
commit: jest.fn()
commit: jest.fn(),
getters: {
applicationUser: {
savedSessionId: 1
}
}
}
});