1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components
2019-01-26 15:20:34 +01:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ chore: update snapshots 2019-01-21 20:54:28 +01:00
PackageSidebar refactor: fix minor issues 2019-01-06 16:19:02 +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 fix: logo on header 2019-01-20 19:25:50 +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 feat: add dependencies navigation 2019-01-20 09:37:03 +01:00
packagedetail.spec.js fix: applied prefer-const 2018-12-16 21:09:03 +01:00
packagelist.spec.js chore: remove header text 2019-01-11 07:25:49 +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();
  });
});