Files
ghibli-api/components/Grid/Grid.spec.js
2020-12-18 04:05:43 +01:00

27 lines
589 B
JavaScript

import { shallowMount } from "@vue/test-utils";
import Grid from "./";
import mockFilms from "@/test/fake-films.json";
describe("Grid", () => {
it("tests props", () => {
expect(Grid.props).toMatchObject({
dataSource: {
type: Array,
required: true
}
});
});
it("should render Grid instance with expected Film components", () => {
const wrapper = shallowMount(Grid, {
propsData: {
dataSource: mockFilms
}
});
expect(wrapper.findAllComponents({ name: "Film" }).length).toBe(
mockFilms.length
);
});
});