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