0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00
verdaccio/test/unit/webui/components/readme.spec.js

23 lines
690 B
JavaScript
Raw Normal View History

2017-11-29 06:50:17 -05:00
/**
* Readme component
*/
import React from 'react';
import { shallow, mount } from 'enzyme';
import Readme from '../../../../src/webui/components/Readme/index';
2017-11-29 06:50:17 -05:00
describe('<Readme /> component', () => {
2018-12-05 13:30:08 -05:00
test('should load the component in default state', () => {
2018-12-14 18:23:30 -05:00
const wrapper = mount(<Readme description={ "test" } />);
expect(wrapper.html()).toMatchSnapshot();
2017-11-29 06:50:17 -05:00
});
2018-12-05 13:30:08 -05:00
test('should dangerously set html', () => {
2018-12-14 18:23:30 -05:00
const wrapper = shallow(<Readme description={ "<h1>This is a test string</h1>" } />);
2017-11-29 06:50:17 -05:00
expect(wrapper.html()).toEqual(
'<div class="markdown-body"><h1>This is a test string</h1></div>'
);
expect(wrapper.html()).toMatchSnapshot();
2017-11-29 06:50:17 -05:00
});
});