Triggering saveOrder before making getPartsOrQuestions call in vin-pages-mixin
This commit is contained in:
parent
81fbe7c9ac
commit
520fdbd674
2 changed files with 9 additions and 1 deletions
|
|
@ -1,9 +1,13 @@
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
|
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
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
|
||||||
navigateForward: jest.fn()
|
navigateForward: jest.fn()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
jest.mock("@/helpers/heritage-integration/order-helper.js", () => ({
|
||||||
|
saveOrder: jest.fn()
|
||||||
|
}));
|
||||||
|
|
||||||
describe("vin-pages-mixin", () => {
|
describe("vin-pages-mixin", () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
|
|
@ -19,7 +23,7 @@ describe("vin-pages-mixin", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
vehicleQuestionsMixin.methods.navigateForward = jest.fn();
|
vehicleQuestionsMixin.methods.navigateForward = jest.fn();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.navigateForwardWithSingleCarMatch();
|
await wrapper.vm.navigateForwardWithSingleCarMatch();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue