1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-15 15:45:44 +07:00
Files
verdaccio-ui/test/unit/components
Juan Picado @jotadeveloper 9d7be476ad chore: relocate unit test (#39)
add new json snapshot serializer
2019-05-01 21:02:46 +02:00
..
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00
2019-05-01 21:02:46 +02:00

/**
 * Readme component
 */

import React from 'react';
import { shallow, mount } from 'enzyme';
import Readme from '../../../src/webui/components/Readme/index';

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();
  });
});