mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
webui: <NotFound /> component test case
This commit is contained in:
parent
6a6d7ed4de
commit
84b29fcf08
1 changed files with 27 additions and 0 deletions
27
test/webui/components/notfound.spec.js
Normal file
27
test/webui/components/notfound.spec.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* NotFound component
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import NotFound from '../../../src/webui/src/components/NotFound';
|
||||
|
||||
console.error = jest.fn();
|
||||
|
||||
describe('<NoItem /> component', () => {
|
||||
it('should give error for the required fields', () => {
|
||||
shallow(<NotFound />);
|
||||
expect(console.error).toBeCalled();
|
||||
});
|
||||
|
||||
it('should set html from props', () => {
|
||||
const props = {
|
||||
pkg: 'verdaccio'
|
||||
};
|
||||
const wrapper = shallow(<NotFound {...props} />);
|
||||
expect(wrapper.find('h1').text()).toEqual('Error 404 - verdaccio');
|
||||
expect(wrapper.find('p').text()).toEqual(
|
||||
'Oops, The package you are trying to access does not exist.'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue