Create Grid component + Test. Index test adaptations
This commit is contained in:
23
test/Grid.spec.js
Normal file
23
test/Grid.spec.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { mount } from "@vue/test-utils";
|
||||
import Grid from "@/components/Grid";
|
||||
import mockFilms from "./fake-films.json";
|
||||
|
||||
describe("Grid", () => {
|
||||
it("tests props", () => {
|
||||
expect(Grid.props).toMatchObject({
|
||||
dataSource: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("should render Grid instance", () => {
|
||||
const wrapper = mount(Grid, {
|
||||
propsData: {
|
||||
dataSource: mockFilms
|
||||
}
|
||||
});
|
||||
expect(JSON.parse(wrapper.text())).toEqual(mockFilms);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user