Tests for all Components

This commit is contained in:
2020-06-12 15:57:30 +00:00
parent 751e09f54b
commit e95dd62ffd
27 changed files with 639 additions and 225 deletions

View File

@ -0,0 +1,30 @@
import {shallow} from "enzyme";
import React from "react";
import VideoContainer from "./VideoContainer";
describe('<VideoContainer/>', function () {
it('renders without crashing ', function () {
const wrapper = shallow(<VideoContainer data={[]}/>);
wrapper.unmount();
});
it('inserts tiles correctly', () => {
const wrapper = shallow(<VideoContainer data={[
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}
]}/>);
expect(wrapper.find('Preview')).toHaveLength(12);
});
it('inserts tiles correctly if not enough available', () => {
const wrapper = shallow(<VideoContainer data={[
{}, {}, {}, {}
]}/>);
expect(wrapper.find('Preview')).toHaveLength(4);
});
it('no items available', () => {
const wrapper = shallow(<VideoContainer data={[]}/>);
expect(wrapper.find('Preview')).toHaveLength(0);
expect(wrapper.find(".maincontent").text()).toBe("no items to show!");
});
});