mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
49c6191bb5
no logic change, just path updates
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/**
|
|
* Help component
|
|
*/
|
|
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/light';
|
|
import Help from '../../../../src/webui/src/components/Help/index';
|
|
|
|
describe('<Help /> component', () => {
|
|
|
|
it('should set html from props with / base path', () => {
|
|
jsdom.reconfigure({
|
|
url: "http://example.com/"
|
|
});
|
|
const wrapper = shallow(<Help />);
|
|
expect(
|
|
wrapper
|
|
.find('#adduser')
|
|
.find(SyntaxHighlighter)
|
|
.dive()
|
|
.text()
|
|
).toEqual('npm adduser --registry http://example.com');
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should set html from props with someOtherPath', () => {
|
|
jsdom.reconfigure({
|
|
url: "http://example.com/someOtherPath"
|
|
});
|
|
const wrapper = shallow(<Help />);
|
|
expect(
|
|
wrapper
|
|
.find('#publish')
|
|
.find(SyntaxHighlighter)
|
|
.dive()
|
|
.text()
|
|
).toEqual('npm publish --registry http://example.com/someOtherPath');
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
});
|
|
});
|