1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/test/unit/webui/components/PackageSidebar/module.spec.js
2019-01-06 11:33:15 +01:00

30 lines
727 B
JavaScript

/**
* Module component
*/
import React from 'react';
import { shallow } from 'enzyme';
import Module from '../../../../../src/webui/components/PackageSidebar/Module/index';
console.error = jest.fn();
describe('<PackageSidebar /> : <Module />', () => {
test('should error for required props', () => {
shallow(<Module />);
expect(console.error).toHaveBeenCalled();
});
test('should load module component', () => {
const props = {
title: 'Test title',
description: 'Test description',
className: 'module-component'
};
const wrapper = shallow(
<Module {...props}>
<p>{'test children'}</p>
</Module>
);
expect(wrapper.html()).toMatchSnapshot();
});
});