1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components/readme.spec.js
Priscila 76482ec8d7 refactor: added flow type checking (#1099)
fix: added import 'github-markdown-css' stub type

fix: fixed tests
2018-10-31 12:54:26 +08:00

23 lines
678 B
JavaScript

/**
* Readme component
*/
import React from 'react';
import { shallow, mount } from 'enzyme';
import Readme from '../../../../src/webui/components/Readme/index';
describe('<Readme /> component', () => {
it('should load the component in default state', () => {
const wrapper = mount(<Readme description='test' />);
expect(wrapper.html()).toMatchSnapshot();
});
it('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();
});
});