DigitalConsumer.ISS/src/router/router.spec.js
2023-01-17 11:16:14 -05:00

28 lines
No EOL
871 B
JavaScript

import router from "@/router/";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
import { issPageValues } from "@/router/router-constants/issPage-values";
import { createApp } from 'vue';
import { createPinia } from "pinia";
import App from '@/App.vue';
describe("Router", () => {
beforeAll(() => {
const vueApp = createApp(App);
const pinia = createPinia();
vueApp.use(pinia);
});
it("Should push next view when navigating locally", () => {
let scenario = navigationScenarios.WELCOME_PAGE;
let currentRoute = { query: { issPage: issPageValues.WELCOME_PAGE }};
router.push = jest.fn();
router.navigate(scenario, currentRoute);
expect(router.push.mock.calls[0][0].query.issPage).toBe(issPageValues.POLICY_HOLDER_DETAILS);
});
});