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

Triggering saveOrder before making getPartsOrQuestions call in vin-pa…
This commit is contained in:
Leah Schumann 2022-08-22 15:50:15 -04:00 committed by GitHub
commit 3f4cc6e4d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -1,9 +1,13 @@
import { storeActions } from "@/constants/store-actions.js";
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();
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
const partsOrQuestions = result.data.partsOrQuestions;

View file

@ -9,6 +9,10 @@ jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
navigateForward: jest.fn()
}));
jest.mock("@/helpers/heritage-integration/order-helper.js", () => ({
saveOrder: jest.fn()
}));
describe("vin-pages-mixin", () => {
afterEach(() => {
jest.clearAllMocks();
@ -19,7 +23,7 @@ describe("vin-pages-mixin", () => {
// Arrange
const { wrapper } = setupMocks({});
vehicleQuestionsMixin.methods.navigateForward = jest.fn();
// Act
await wrapper.vm.navigateForwardWithSingleCarMatch();