Pass tests

This commit is contained in:
2020-12-07 15:37:32 +01:00
parent d826e758ff
commit 83c1269d25
20 changed files with 3798 additions and 129 deletions

View File

@@ -1,9 +1,21 @@
import { mount, RouterLinkStub } from "@vue/test-utils";
import GridItem from "@/components/GridItem.vue";
import { mount, RouterLinkStub, createLocalVue } from "@vue/test-utils";
import Vuex from "vuex";
import GridItem from "@/components/Grid/GridItem.vue";
const localVue = createLocalVue();
localVue.use(Vuex);
describe("Test GridItem.", () => {
let store;
beforeEach(() => {
store = new Vuex.Store();
});
it("checks link.", async () => {
const wrapper = mount(GridItem, {
store,
localVue,
propsData: {
item: {
id: 3,

View File

@@ -1,14 +1,24 @@
import { mount } from "@vue/test-utils";
import { mount, createLocalVue } from "@vue/test-utils";
import Vuex from "vuex";
import App from "@/App.vue";
const localVue = createLocalVue();
localVue.use(Vuex);
describe("App", () => {
const wrapper = mount(App, { stubs: ["router-view", "router-link"] });
let store;
beforeEach(() => {
store = new Vuex.Store();
});
it("should be a Vue instance", () => {
const wrapper = mount(App, { store, localVue, stubs: ["router-link", "router-view"] });
expect(wrapper.vm).toBeTruthy();
});
it("renders correctly", () => {
const wrapper = mount(App, { store, localVue, stubs: ["router-link", "router-view"] });
expect(wrapper.find("#app")).toBeTruthy();
});
});