1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-05-06 19:41:36 +07:00
verdaccio-ui/src/components/Readme/Readme.spec.tsx
2020-03-31 08:44:59 +02:00

21 lines
652 B
TypeScript

import React from 'react';
import { mount } from '../../utils/test-enzyme';
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', () => {
const wrapper = mount(<Readme description="<h1>This is a test string</h1>" />);
expect(wrapper.html()).toEqual(
'<div class="markdown-body css-beaqbv-Wrapper ecnabbe0"><h1>This is a test string</h1></div>'
);
expect(wrapper.html()).toMatchSnapshot();
});
});