Create Vehicle page layout

This commit is contained in:
2020-12-21 23:45:00 +01:00
parent add48e09a8
commit 5df1f1769e
4 changed files with 78 additions and 8 deletions

View File

@@ -2,6 +2,8 @@ import { mount, createLocalVue } from "@vue/test-utils";
import Vuex from "vuex";
import Vehicle from "./_id";
import mockVehicles from "@/test/fake-vehicles.json";
import mockPeople from "@/test/fake-people.json";
import mockFilms from "@/test/fake-films.json";
let $route = {
path: "/vehicles",
@@ -39,8 +41,11 @@ describe("Vehicle page", () => {
localVue,
store,
computed: {
vehicle: () => mockVehicles[0]
}
vehicle: () => mockVehicles[0],
pilot: () => mockPeople[0],
film: () => mockFilms[0]
},
stubs: ["nuxt-link"]
});
expect(wrapper.exists()).toBe(true);
});
@@ -64,8 +69,11 @@ describe("Vehicle page", () => {
localVue,
store,
computed: {
vehicle: () => mockVehicles[0]
}
vehicle: () => mockVehicles[0],
pilot: () => jest.fn(),
film: () => jest.fn()
},
stubs: ["nuxt-link"]
});
await wrapper.vm.$options.asyncData({ store, params: $route.params });