0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-03 23:09:17 -05:00
verdaccio/test/unit/webui/components/PackageSidebar/moduleContentPlaceholder.spec.js

24 lines
694 B
JavaScript
Raw Normal View History

2017-12-20 09:40:53 +05:30
/**
* ModuleContentPlaceholder component
*/
import React from 'react';
import { shallow } from 'enzyme';
import ModuleContentPlaceholder from '../../../../../src/webui/components/PackageSidebar/ModuleContentPlaceholder/index';
2017-12-20 09:40:53 +05:30
console.error = jest.fn();
describe('<PackageSidebar /> : <ModuleContentPlaceholder />', () => {
2018-12-05 19:30:08 +01:00
test('should error for required props', () => {
2017-12-20 09:40:53 +05:30
shallow(<ModuleContentPlaceholder />);
expect(console.error).toBeCalled();
});
2018-12-05 19:30:08 +01:00
test('should load module component', () => {
2017-12-20 09:40:53 +05:30
const props = {
text: 'Test text'
};
2018-12-15 00:23:30 +01:00
const wrapper = shallow(<ModuleContentPlaceholder { ...props } />);
2017-12-20 09:40:53 +05:30
expect(wrapper.html()).toMatchSnapshot();
});
});