DigitalConsumer.ISS/src/layouts/service-location/service-location.spec.js
saumyaChaturvedi123 aff5ca54f1 SSR-361
Navigation to/from provider preference page
2023-04-07 15:25:44 +05:30

32 lines
No EOL
789 B
JavaScript

import { shallowMount } from "@vue/test-utils";
import { getMountOptions } from "@/helpers/unit-test-helper.js";
import serviceLocationModal from "@/layouts/service-location/service-location.vue";
describe("navigation", () => {
test("if the back button is clicked, navigate back", async () => {
// Arrange
const { wrapper } = setupMocks({
});
// Act
await wrapper.vm.backButtonAction();
// Assert
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
});
});
function setupMocks()
{
const wrapper = shallowMount(
serviceLocationModal,
getMountOptions({
router: {
navigate: jest.fn(),
},
})
);
return { wrapper };
}