2017-11-29 07:23:12 -05:00
|
|
|
/**
|
|
|
|
* NoItems component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2018-10-31 00:00:59 -05:00
|
|
|
import { shallow, mount } from 'enzyme';
|
2018-07-17 14:22:44 -05:00
|
|
|
import NoItems from '../../../../src/webui/components/NoItems/index';
|
2017-11-29 07:23:12 -05:00
|
|
|
|
|
|
|
console.error = jest.fn();
|
|
|
|
|
|
|
|
describe('<NoItem /> component', () => {
|
2018-12-05 13:30:08 -05:00
|
|
|
test('should load the component in default state', () => {
|
2018-10-31 00:00:59 -05:00
|
|
|
const wrapper = mount(<NoItems />);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-11-29 07:23:12 -05:00
|
|
|
});
|
|
|
|
|
2018-12-05 13:30:08 -05:00
|
|
|
test('should set html from props', () => {
|
2017-11-29 07:23:12 -05:00
|
|
|
const props = {
|
|
|
|
text: 'This is a test string'
|
|
|
|
};
|
2018-12-15 10:39:51 -05:00
|
|
|
const wrapper = shallow(<NoItems {...props} />);
|
2017-12-02 07:34:42 -05:00
|
|
|
expect(wrapper.find('h2').text()).toEqual('This is a test string');
|
2017-12-02 09:01:06 -05:00
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-11-29 07:23:12 -05:00
|
|
|
});
|
|
|
|
});
|