32 lines
No EOL
789 B
JavaScript
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 };
|
|
} |