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-02-06 23:34:40 +01:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ refactor: fixes unit tests for detail URLs 2019-02-06 23:34:40 +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 Merge branch 'feat-new-detail-page' into fix-1013 2019-01-26 15:32:51 +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 feat: not found page (#1208) 2019-01-31 21:58:59 +01:00
package.spec.js feat: add dependencies navigation 2019-01-20 09:37: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 chore: fix unit test for search 2019-01-22 21:09:46 +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();
  });
});