Merge pull request #687 from Safelite/feature/CSR-722
Triggering saveOrder before making getPartsOrQuestions call in vin-pa…
This commit is contained in:
commit
3f4cc6e4d5
2 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue