2019-04-05 02:23:40 +07:00
|
|
|
/**
|
|
|
|
* NoItems component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { shallow, mount } from 'enzyme';
|
2019-05-02 02:02:46 +07:00
|
|
|
import NoItems from '../../../src/webui/components/NoItems/index';
|
2019-04-05 02:23:40 +07:00
|
|
|
|
|
|
|
console.error = jest.fn();
|
|
|
|
|
|
|
|
describe('<NoItem /> component', () => {
|
|
|
|
test('should load the component in default state', () => {
|
|
|
|
const wrapper = shallow(<NoItems />);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('should set html from props', () => {
|
|
|
|
const props = {
|
|
|
|
text: 'This is a test string'
|
|
|
|
};
|
|
|
|
const wrapper = mount(<NoItems {...props} />);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|