2017-11-29 12:50:17 +01:00
|
|
|
/**
|
|
|
|
* Readme component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2018-10-31 05:54:26 +01:00
|
|
|
import { shallow, mount } from 'enzyme';
|
2018-07-17 21:22:44 +02:00
|
|
|
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', () => {
|
2018-12-15 00:23:30 +01:00
|
|
|
const wrapper = mount(<Readme description={ "test" } />);
|
2018-10-31 05:54:26 +01:00
|
|
|
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', () => {
|
2018-12-15 00:23:30 +01:00
|
|
|
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>'
|
|
|
|
);
|
2017-12-02 15:01:06 +01:00
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-11-29 12:50:17 +01:00
|
|
|
});
|
|
|
|
});
|