Create Film component

This commit is contained in:
2020-12-18 01:31:09 +01:00
parent 214921a6e8
commit ab465bbe16
4 changed files with 178 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { mount } from "@vue/test-utils";
import { shallowMount } from "@vue/test-utils";
import Grid from "@/components/Grid";
import mockFilms from "./fake-films.json";
@@ -12,12 +12,15 @@ describe("Grid", () => {
});
});
it("should render Grid instance", () => {
const wrapper = mount(Grid, {
it("should render Grid instance with expected Film components", () => {
const wrapper = shallowMount(Grid, {
propsData: {
dataSource: mockFilms
}
});
expect(JSON.parse(wrapper.text())).toEqual(mockFilms);
expect(wrapper.findAllComponents({ name: "Film" }).length).toBe(
mockFilms.length
);
});
});