1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-16 19:24:28 +07:00
verdaccio-ui/test/unit/components/readme.spec.js

23 lines
683 B
JavaScript
Raw Normal View History

2019-04-05 02:23:40 +07:00
/**
* Readme component
*/
import React from 'react';
import { shallow, mount } from 'enzyme';
import Readme from '../../../src/webui/components/Readme/index';
2019-04-05 02:23:40 +07:00
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', () => {
const wrapper = shallow(<Readme description={"<h1>This is a test string</h1>"} />);
expect(wrapper.html()).toEqual(
'<div class="markdown-body"><h1>This is a test string</h1></div>'
);
expect(wrapper.html()).toMatchSnapshot();
});
});