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-12-15 16:39:51 +01: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 />', () => {
test('should load the component without props', () => {
const wrapper = shallow(<Infos />);
expect(wrapper.html()).toMatchSnapshot();
});
test('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();
});
test('should load the Info component with homepage only', () => {
const props = {
homepage: 'https://www.verdaccio.org'
}
const wrapper = shallow(<Infos {...props} />);
expect(wrapper.html()).toMatchSnapshot();
});
test('should load the Info component with license only', () => {
const props = {
license: 'MIT',
}
const wrapper = shallow(<Infos {...props} />);
expect(wrapper.html()).toMatchSnapshot();
});
test('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();
});
});