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-14 23:57:52 +01:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ Package Refactor (#1145) 2018-12-13 19:05:47 +01:00
PackageSidebar Merge branch '4.x' into refactor-eslint 2018-12-07 08:14: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 Refactor: Moved Search to Header (#1064) 2018-10-27 21:19:45 +02: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: update it to test 2018-12-05 19:30:08 +01:00
notfound.spec.js chore: update it to test 2018-12-05 19:30:08 +01:00
package.spec.js Merge remote-tracking branch 'origin/4.x' into refactor-eslint 2018-12-14 23:57:52 +01:00
packagedetail.spec.js chore: update it to test 2018-12-05 19:30:08 +01:00
packagelist.spec.js Merge remote-tracking branch 'origin/4.x' into refactor-eslint 2018-12-14 23:57:52 +01:00
readme.spec.js chore: update it to test 2018-12-05 19:30:08 +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();
  });
});