mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
30 lines
708 B
JavaScript
30 lines
708 B
JavaScript
|
/**
|
||
|
* Module component
|
||
|
*/
|
||
|
|
||
|
import React from 'react';
|
||
|
import { shallow } from 'enzyme';
|
||
|
import Module from '../../../../src/webui/src/components/PackageSidebar/Module';
|
||
|
|
||
|
console.error = jest.fn();
|
||
|
|
||
|
describe('<PackageSidebar /> : <Module />', () => {
|
||
|
it('should error for required props', () => {
|
||
|
shallow(<Module />);
|
||
|
expect(console.error).toBeCalled();
|
||
|
});
|
||
|
it('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();
|
||
|
});
|
||
|
});
|