0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/webui/components
2018-01-07 07:59:36 +00:00
..
help.spec.js WIP: package & Package list component tests 2018-01-07 07:59:36 +00:00
noitems.spec.js webui: <NoItems /> component test case 2018-01-07 07:59:36 +00:00
notfound.spec.js webui: <NotFound /> component test case 2018-01-07 07:59:36 +00:00
package.spec.js WIP: package & Package list component tests 2018-01-07 07:59:36 +00:00
packagedetail.spec.js Package detail component test 2018-01-07 07:59:36 +00:00
packagelist.spec.js WIP: package & Package list component tests 2018-01-07 07:59:36 +00:00
readme.spec.js webui: <Readme /> component test case 2018-01-07 07:59:36 +00:00
search.spec.js webui: <Search /> component test case 2018-01-07 07:59:36 +00:00

/**
 * Readme component
 */

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

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>'
    );
  });
});