2019-06-20 19:37:28 +07:00
|
|
|
import React from 'react';
|
2019-11-23 19:41:14 +07:00
|
|
|
|
|
|
|
import { mount } from '../../utils/test-enzyme';
|
2019-10-08 03:19:18 +07:00
|
|
|
|
2019-06-20 19:37:28 +07:00
|
|
|
import Readme from './Readme';
|
|
|
|
|
|
|
|
describe('<Readme /> component', () => {
|
|
|
|
test('should load the component in default state', () => {
|
|
|
|
const wrapper = mount(<Readme description="test" />);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('should dangerously set html', () => {
|
2019-08-31 16:02:46 +07:00
|
|
|
const wrapper = mount(<Readme description="<h1>This is a test string</h1>" />);
|
2020-03-31 13:44:59 +07:00
|
|
|
expect(wrapper.html()).toEqual(
|
|
|
|
'<div class="markdown-body css-beaqbv-Wrapper ecnabbe0"><h1>This is a test string</h1></div>'
|
|
|
|
);
|
2019-06-20 19:37:28 +07:00
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|