0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/unit/webui/components
2018-07-01 15:45:26 +02:00
..
__mocks__ refactor: unit tests and api service 2018-06-30 12:22:07 +02:00
__snapshots__ refactor: adds tesURL for test cases 2018-07-01 15:45:26 +02:00
PackageSidebar refactor: adds tesURL for test cases 2018-07-01 15:45:26 +02:00
store refactor: unit tests and api service 2018-06-30 12:22:07 +02:00
header.spec.js refactor: unit tests and api service 2018-06-30 12:22:07 +02:00
help.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00
noitems.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00
notfound.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00
package.spec.js test: restore snapshot unit test 2018-06-23 20:57:17 +02:00
packagedetail.spec.js refactor: migration assert to expect 2018-06-28 18:33:37 +02:00
packagelist.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00
readme.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00
search.spec.js refactor: relocate unit test 2018-06-23 20:57:12 +02:00

/**
 * Readme component
 */

import React from 'react';
import { shallow } from 'enzyme';
import Readme from '../../../../src/webui/src/components/Readme/index';

console.error = jest.fn();

describe('<Readme /> component', () => {
  it('should give error for the required fields', () => {
    shallow(<Readme />);
    expect(console.error).toBeCalled();
  });

  it('should dangerously set html', () => {
    const props = {
      readMe: '<h1>This is a test string</h1>'
    };
    const wrapper = shallow(<Readme {...props} />);
    expect(wrapper.html()).toEqual(
      '<div class="markdown-body"><h1>This is a test string</h1></div>'
    );
    expect(wrapper.html()).toMatchSnapshot();
  });
});