0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00
verdaccio/test/unit/webui/components
Juan Picado @jotadeveloper 530f4cb629
chore: update snapshopts
2018-12-16 12:32:49 +01:00
..
__mocks__
__snapshots__ chore: update snapshot 2018-12-15 16:43:43 +01:00
PackageSidebar chore: update snapshopts 2018-12-16 12:32:49 +01:00
store
copyToClipBoard.spec.js
footer.spec.js
header.spec.js
help.spec.js
login.spec.js
noitems.spec.js chore: enable react/jsx-curly-spacing as error 2018-12-15 16:39:51 +01:00
notfound.spec.js chore: enable react/jsx-curly-spacing as error 2018-12-15 16:39:51 +01:00
package.spec.js chore: enable react/jsx-first-prop-new-line as error 2018-12-15 16:59:05 +01:00
packagedetail.spec.js chore: enable react/jsx-curly-spacing as error 2018-12-15 16:39:51 +01:00
packagelist.spec.js chore: enable react/jsx-curly-spacing as error 2018-12-15 16:39:51 +01:00
readme.spec.js chore: enable react/jsx-curly-spacing as error 2018-12-15 16:39:51 +01:00
search.spec.js

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