1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 16:06:40 +01:00

Fixes path

This commit is contained in:
Amir
2019-06-13 15:21:49 -07:00
parent fde6892783
commit 77e2426605

View File

@@ -1,45 +0,0 @@
import fetchMock from "fetch-mock";
import EventSource from "eventsourcemock";
import { shallowMount, RouterLinkStub } from "@vue/test-utils";
import App from "./App";
describe("<App />", () => {
const stubs = { RouterLink: RouterLinkStub, "router-view": true };
beforeEach(() => {
global.BASE_PATH = "";
global.EventSource = EventSource;
fetchMock.getOnce("/api/containers.json", [{ id: "abc", name: "Test 1" }, { id: "xyz", name: "Test 2" }]);
});
afterEach(() => fetchMock.reset());
test("is a Vue instance", async () => {
const wrapper = shallowMount(App, { stubs });
expect(wrapper.isVueInstance()).toBeTruthy();
});
test("has right title", async () => {
const wrapper = shallowMount(App, { stubs });
await fetchMock.flush();
expect(wrapper.vm.title).toContain("2 containers");
});
test("renders correctly", async () => {
const wrapper = shallowMount(App, { stubs });
await fetchMock.flush();
expect(wrapper.element).toMatchSnapshot();
});
test("renders router-link correctly", async () => {
const wrapper = shallowMount(App, { stubs });
await fetchMock.flush();
expect(wrapper.find(RouterLinkStub).props().to).toMatchInlineSnapshot(`
Object {
"name": "container",
"params": Object {
"id": "abc",
"name": "Test 1",
},
}
`);
});
});