1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/webui/components/packagedetail.spec.js

28 lines
692 B
JavaScript
Raw Normal View History

2017-11-30 17:31:25 +01:00
/**
* PackageDetail component
*/
import React from 'react';
import { shallow } from 'enzyme';
import PackageDetail from '../../../src/webui/src/components/PackageDetail';
console.error = jest.fn();
describe('<PackageDetail /> component', () => {
it('should give error for required props', () => {
shallow(<PackageDetail />);
expect(console.error).toBeCalled();
});
it('should load the component', () => {
const props = {
readMe: 'Test readme',
package: 'Verdaccio'
};
const wrapper = shallow(<PackageDetail {...props} />);
expect(wrapper.find('h1').text()).toEqual('Verdaccio');
// here write a test to match readMe prop
});
});