1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components/notfound.spec.js
Juan Picado @jotadeveloper f4e9d3208a
chore: update it to test
2018-12-05 19:30:08 +01:00

29 lines
806 B
JavaScript

/**
* NotFound component
*/
import React from 'react';
import { shallow, mount } from 'enzyme';
import NotFound from '../../../../src/webui/components/NotFound/index';
console.error = jest.fn();
describe('<NotFound /> component', () => {
test('should load the component in default state', () => {
const wrapper = mount(<NotFound pkg='test' />);
expect(wrapper.html()).toMatchSnapshot();
});
test('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();
});
});