2020-06-19 00:16:18 +02:00
|
|
|
import React from 'react';
|
2020-10-25 18:48:23 +00:00
|
|
|
import {shallow} from 'enzyme';
|
2020-06-19 00:16:18 +02:00
|
|
|
|
2020-12-17 20:53:22 +00:00
|
|
|
import PageTitle, {Line} from './PageTitle';
|
2020-06-19 00:16:18 +02:00
|
|
|
|
|
|
|
describe('<Preview/>', function () {
|
|
|
|
it('renders without crashing ', function () {
|
|
|
|
const wrapper = shallow(<PageTitle/>);
|
|
|
|
wrapper.unmount();
|
|
|
|
});
|
2020-06-19 18:21:42 +02:00
|
|
|
|
|
|
|
it('renders childs correctly', function () {
|
|
|
|
const wrapper = shallow(<PageTitle>heyimachild</PageTitle>);
|
|
|
|
|
|
|
|
const children = wrapper.children();
|
2020-10-25 18:48:23 +00:00
|
|
|
expect(children.at(children.length - 2).text()).toBe('heyimachild');
|
2020-06-19 18:21:42 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it('renders pagetitle prop', function () {
|
|
|
|
const wrapper = shallow(<PageTitle title='testtitle'/>);
|
|
|
|
|
2020-10-25 18:48:23 +00:00
|
|
|
expect(wrapper.find('.pageheader').text()).toBe('testtitle<Line />');
|
2020-06-19 18:21:42 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it('renders subtitle prop', function () {
|
|
|
|
const wrapper = shallow(<PageTitle subtitle='testsubtitle'/>);
|
|
|
|
|
2020-10-25 18:48:23 +00:00
|
|
|
expect(wrapper.find('.pageheadersubtitle').text()).toBe('testsubtitle');
|
2020-06-19 18:21:42 +02:00
|
|
|
});
|
2020-06-19 00:16:18 +02:00
|
|
|
});
|
|
|
|
|
2020-12-17 20:53:22 +00:00
|
|
|
describe('<Line/>', () => {
|
|
|
|
it('renders without crashing', function () {
|
|
|
|
const wrapper = shallow(<Line/>);
|
|
|
|
wrapper.unmount();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|