mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 21:33:18 +01:00
* Use iconmoon * Adds icons * Use go to update BASE * Changes more icons * Uses html inline * Reverts css changes * Fixes icons * Fixes tests and icons * Adds --rm to int tests * Fixes unit tests
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import EventSource from "eventsourcemock";
|
|
import { shallowMount, RouterLinkStub, createLocalVue } from "@vue/test-utils";
|
|
import Vuex from "vuex";
|
|
import App from "./App";
|
|
|
|
const localVue = createLocalVue();
|
|
|
|
localVue.use(Vuex);
|
|
|
|
describe("<App />", () => {
|
|
const stubs = { RouterLink: RouterLinkStub, "router-view": true, icon: true };
|
|
let store;
|
|
|
|
beforeEach(() => {
|
|
global.BASE_PATH = "";
|
|
global.EventSource = EventSource;
|
|
const state = {
|
|
containers: [
|
|
{ id: "abc", name: "Test 1" },
|
|
{ id: "xyz", name: "Test 2" },
|
|
],
|
|
settings: { menuWidth: 15 },
|
|
};
|
|
|
|
const actions = {
|
|
FETCH_CONTAINERS: () => Promise.resolve(),
|
|
};
|
|
|
|
store = new Vuex.Store({
|
|
state,
|
|
actions,
|
|
});
|
|
});
|
|
|
|
test("is a Vue instance", async () => {
|
|
const wrapper = shallowMount(App, { stubs, store, localVue });
|
|
expect(wrapper.isVueInstance()).toBeTruthy();
|
|
});
|
|
|
|
test("has right title", async () => {
|
|
const wrapper = shallowMount(App, { stubs, store, localVue });
|
|
await wrapper.vm.$nextTick();
|
|
expect(wrapper.vm.title).toContain("2 containers");
|
|
});
|
|
|
|
test("renders correctly", async () => {
|
|
const wrapper = shallowMount(App, { stubs, store, localVue });
|
|
await wrapper.vm.$nextTick();
|
|
expect(wrapper.element).toMatchSnapshot();
|
|
});
|
|
});
|