0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/unit/webui/components/notfound.spec.js
Juan Picado @jotadeveloper 49c6191bb5
refactor: relocate unit test
no logic change, just path updates
2018-06-23 20:57:12 +02:00

28 lines
767 B
JavaScript

/**
* NotFound component
*/
import React from 'react';
import { shallow } from 'enzyme';
import NotFound from '../../../../src/webui/src/components/NotFound/index';
console.error = jest.fn();
describe('<NotFound /> 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.'
);
expect(wrapper.html()).toMatchSnapshot();
});
});