Create Film component
This commit is contained in:
@@ -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
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user