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