1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components
2018-12-16 21:27:20 +01:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ chore: update snapshot 2018-12-15 16:43:43 +01:00
PackageSidebar fix: applied valid-expect-in-promise 2018-12-16 21:27:20 +01:00
store fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
copyToClipBoard.spec.js refactor: add space in curly braces -> object-curly-spacing (#1035) 2018-10-01 07:06:30 +02:00
footer.spec.js chore: update it to test 2018-12-05 19:30:08 +01:00
header.spec.js chore: fix test 2018-12-15 09:18:26 +01:00
help.spec.js chore: update it to test 2018-12-05 19:30:08 +01:00
login.spec.js chore: update it to test 2018-12-05 19:30:08 +01:00
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 fix: applied prefer-const 2018-12-16 21:09:03 +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 Package Refactor (#1145) 2018-12-13 19:05:47 +01: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();
  });
});