2017-12-20 05:10:53 +01:00
|
|
|
/**
|
|
|
|
* Module component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
2018-07-17 21:22:44 +02:00
|
|
|
import Module from '../../../../../src/webui/components/PackageSidebar/Module/index';
|
2017-12-20 05:10:53 +01:00
|
|
|
|
|
|
|
console.error = jest.fn();
|
|
|
|
|
|
|
|
describe('<PackageSidebar /> : <Module />', () => {
|
2018-12-05 19:30:08 +01:00
|
|
|
test('should error for required props', () => {
|
2017-12-20 05:10:53 +01:00
|
|
|
shallow(<Module />);
|
|
|
|
expect(console.error).toBeCalled();
|
|
|
|
});
|
2018-12-05 19:30:08 +01:00
|
|
|
test('should load module component', () => {
|
2017-12-20 05:10:53 +01:00
|
|
|
const props = {
|
|
|
|
title: 'Test title',
|
|
|
|
description: 'Test description',
|
|
|
|
className: 'module-component'
|
|
|
|
};
|
|
|
|
const wrapper = shallow(
|
2018-12-15 00:23:30 +01:00
|
|
|
<Module { ...props }>
|
2017-12-20 05:10:53 +01:00
|
|
|
<p>test children</p>
|
|
|
|
</Module>
|
|
|
|
);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|