2017-12-19 23:10:53 -05:00
|
|
|
/**
|
|
|
|
* Module component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
2018-06-17 06:34:59 -05:00
|
|
|
import Module from '../../../../../src/webui/src/components/PackageSidebar/Module/index';
|
2017-12-19 23:10:53 -05:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|