Pass tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { mount, createLocalVue } from "@vue/test-utils";
|
||||
import Vuex from "vuex";
|
||||
import Film from "./_id";
|
||||
import mockFilms from "@/test/fake-films.json";
|
||||
|
||||
let $route = {
|
||||
path: "/films",
|
||||
@@ -20,7 +21,10 @@ describe("Film page", () => {
|
||||
film: {}
|
||||
};
|
||||
actions = {
|
||||
getFilm: jest.fn()
|
||||
getFilm: jest.fn(),
|
||||
getPeople: jest.fn(),
|
||||
getVehicles: jest.fn(),
|
||||
getLocations: jest.fn()
|
||||
};
|
||||
getters = {
|
||||
film: jest.fn()
|
||||
@@ -38,7 +42,13 @@ describe("Film page", () => {
|
||||
});
|
||||
|
||||
it("should render Film page instance", () => {
|
||||
const wrapper = mount(Film, { localVue, store });
|
||||
const wrapper = mount(Film, {
|
||||
localVue,
|
||||
store,
|
||||
computed: {
|
||||
film: () => mockFilms[0]
|
||||
}
|
||||
});
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
});
|
||||
|
||||
@@ -59,7 +69,10 @@ describe("Film page", () => {
|
||||
it("should dispatch getFilm action", async () => {
|
||||
let wrapper = mount(Film, {
|
||||
localVue,
|
||||
store
|
||||
store,
|
||||
computed: {
|
||||
film: () => mockFilms[0]
|
||||
}
|
||||
});
|
||||
|
||||
await wrapper.vm.$options.asyncData({ store, params: $route.params });
|
||||
|
||||
Reference in New Issue
Block a user