OpenMediaCenter/src/elements/VideoContainer/VideoContainer.test.js
Lukas Heiligenbrunner e5ef1f94a4 non selectable text
tags side by side
load 16 videopreviews instead of 12 for huge monitor sizes
2020-08-30 22:01:54 +00:00

31 lines
1.0 KiB
JavaScript

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 if enough available', () => {
const wrapper = shallow(<VideoContainer data={[
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}
]}/>);
expect(wrapper.find('Preview')).toHaveLength(16);
});
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!");
});
});