mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-04-01 02:42:23 -05:00
webui: <NoItems /> component test case
This commit is contained in:
parent
b77c0ea7bb
commit
e38f284b0b
1 changed files with 26 additions and 0 deletions
26
test/webui/components/noitems.spec.js
Normal file
26
test/webui/components/noitems.spec.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* NoItems component
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import NoItems from '../../../src/webui/src/components/NoItems';
|
||||
|
||||
console.error = jest.fn();
|
||||
|
||||
describe('<NoItem /> component', () => {
|
||||
it('should give error for the required fields', () => {
|
||||
shallow(<NoItems />);
|
||||
expect(console.error).toBeCalled();
|
||||
});
|
||||
|
||||
it('should set html from props', () => {
|
||||
const props = {
|
||||
text: 'This is a test string'
|
||||
};
|
||||
const wrapper = shallow(<NoItems {...props} />);
|
||||
expect(wrapper.find('h2').text()).toEqual(
|
||||
'This is a test string'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Add table
Reference in a new issue