1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components/PackageSidebar/infos.spec.js
2018-07-22 21:22:51 +02:00

47 lines
1.4 KiB
JavaScript

/**
* Infos component
*/
import React from 'react';
import { shallow } from 'enzyme';
import Infos from '../../../../../src/webui/components/PackageSidebar/modules/Infos/index';
describe('<PackageSidebar /> : <Infos />', () => {
it('should load the component without props', () => {
const wrapper = shallow(<Infos/>);
expect(wrapper.html()).toMatchSnapshot();
});
it('should load the Info component with props', () => {
const props = {
homepage: 'https://www.verdaccio.org',
license: 'MIT',
repository: 'https://github.com/verdaccio/verdaccio'
}
const wrapper = shallow(<Infos {...props}/>);
expect(wrapper.html()).toMatchSnapshot();
});
it('should load the Info component with homepage only', () => {
const props = {
homepage: 'https://www.verdaccio.org'
}
const wrapper = shallow(<Infos {...props} />);
expect(wrapper.html()).toMatchSnapshot();
});
it('should load the Info component with license only', () => {
const props = {
license: 'MIT',
}
const wrapper = shallow(<Infos {...props} />);
expect(wrapper.html()).toMatchSnapshot();
});
it('should load the Info component with repository only', () => {
const props = { repository: 'https://github.com/verdaccio/verdaccio' };
const wrapper = shallow(<Infos {...props} />);
expect(wrapper.html()).toMatchSnapshot();
});
});