From 77e24266050e2ec7bf0c66a91d98b3420d63acfc Mon Sep 17 00:00:00 2001 From: Amir Date: Thu, 13 Jun 2019 15:21:49 -0700 Subject: [PATCH] Fixes path --- assets/app.spec.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 assets/app.spec.js diff --git a/assets/app.spec.js b/assets/app.spec.js deleted file mode 100644 index c386e616..00000000 --- a/assets/app.spec.js +++ /dev/null @@ -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("", () => { - 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", - }, - } - `); - }); -});