1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components/readme.spec.js

23 lines
686 B
JavaScript
Raw Normal View History

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