0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00
verdaccio/test/unit/webui/components
2019-02-06 23:45:48 +01:00
..
__mocks__
__snapshots__ refactor: fixes unit tests for <NoItems/> component 2019-02-06 23:45:48 +01:00
store
copyToClipBoard.spec.js
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 refactor: fixes unit tests for <NoItems/> component 2019-02-06 23:45:48 +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();
  });
});