2017-11-29 17:20:17 +05:30
|
|
|
/**
|
|
|
|
* 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 17:20:17 +05:30
|
|
|
|
|
|
|
describe('<Readme /> component', () => {
|
2018-10-31 05:54:26 +01:00
|
|
|
it('should load the component in default state', () => {
|
|
|
|
const wrapper = mount(<Readme description='test' />);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-11-29 17:20:17 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('should dangerously set html', () => {
|
2018-10-31 05:54:26 +01:00
|
|
|
const wrapper = shallow(<Readme description='<h1>This is a test string</h1>' />);
|
2017-11-29 17:20:17 +05:30
|
|
|
expect(wrapper.html()).toEqual(
|
|
|
|
'<div class="markdown-body"><h1>This is a test string</h1></div>'
|
|
|
|
);
|
2017-12-02 19:31:06 +05:30
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-11-29 17:20:17 +05:30
|
|
|
});
|
|
|
|
});
|