mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
49c6191bb5
no logic change, just path updates
30 lines
928 B
JavaScript
30 lines
928 B
JavaScript
/**
|
|
* MaintainerInfo component
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import MaintainerInfo from '../../../../../src/webui/src/components/PackageSidebar/modules/Maintainers/MaintainerInfo/index';
|
|
|
|
console.error = jest.fn();
|
|
|
|
describe('<PackageSidebar /> : <Maintainers /> <MaintainerInfo />', () => {
|
|
it('should throw error for required props', () => {
|
|
shallow(<MaintainerInfo />);
|
|
expect(console.error).toBeCalled();
|
|
});
|
|
|
|
it('should load the component and match with snapshot', () => {
|
|
const props = {
|
|
title: 'test-title',
|
|
name: 'test',
|
|
avatar: 'http://xyz.com/profile.jpg'
|
|
};
|
|
const wrapper = shallow(<MaintainerInfo {...props} />);
|
|
expect(wrapper.find('.maintainer').prop('title')).toEqual('test');
|
|
expect(wrapper.find('img').prop('src')).toEqual(
|
|
'http://xyz.com/profile.jpg'
|
|
);
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
});
|
|
});
|