1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/webui/components/notfound.spec.js
Ayush Sharma 5ae7863d8f webui snapshot testing
deps fixes for ui tests

snapshot fixes
2018-01-07 07:59:36 +00:00

29 lines
758 B
JavaScript

/**
* NotFound component
*/
import React from 'react';
import { shallow } from 'enzyme';
import NotFound from '../../../src/webui/src/components/NotFound';
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();
});
});