commit
This commit is contained in:
parent
acf56b14f3
commit
a0bcbce6f5
1 changed files with 30 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { shallowMount } from "@vue/test-utils";
|
||||||
|
import loadingModal from "./loading-modal";
|
||||||
|
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||||
|
|
||||||
|
jest.mock("@/assets/img/loader.gif", () => "loader.gif");
|
||||||
|
jest.mock("@/assets/img/windshield.png", () => "windshield.png");
|
||||||
|
|
||||||
|
describe("loadingModal", () => {
|
||||||
|
test("showModal sets modal visible", async () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks();
|
||||||
|
wrapper.vm.isModalVisible = false;
|
||||||
|
|
||||||
|
//Act
|
||||||
|
wrapper.vm.showModal();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.isModalVisible).toEqual(true);
|
||||||
|
wrapper.unmount();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function setupMocks() {
|
||||||
|
|
||||||
|
const mountOptions = getMountOptions({
|
||||||
|
});
|
||||||
|
|
||||||
|
const wrapper = shallowMount(loadingModal, mountOptions);
|
||||||
|
return { wrapper };
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue