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