1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components/noitems.spec.js

26 lines
681 B
JavaScript
Raw Normal View History

2017-11-29 13:23:12 +01:00
/**
* NoItems component
*/
import React from 'react';
import { shallow, mount } from 'enzyme';
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', () => {
const wrapper = mount(<NoItems />);
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'
};
const wrapper = shallow(<NoItems {...props} />);
expect(wrapper.find('h2').text()).toEqual('This is a test string');
expect(wrapper.html()).toMatchSnapshot();
2017-11-29 13:23:12 +01:00
});
});