0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/webui/components
ayusharma e5ea0c2f5b fix: dynamic date generation for <Package /> component test
fix: adds <Package /> component snapshot
2018-06-18 23:49:51 +02:00
..
__mocks__ Merge branch 'master' into issue-542 2018-03-24 20:15:58 +01:00
__snapshots__ fix: dynamic date generation for <Package /> component test 2018-06-18 23:49:51 +02:00
PackageSidebar Changes as requested by reviewer. 2018-06-14 08:43:01 +02:00
store fix: unit test and better error handling 2018-03-24 10:12:25 +01:00
header.spec.js fix: make enter key submit the login modal form 2018-05-07 16:03:16 -04:00
help.spec.js build: update jest dependencies 2018-01-15 23:04:58 +00:00
noitems.spec.js webui snapshot testing 2018-01-07 07:59:36 +00:00
notfound.spec.js webui snapshot testing 2018-01-07 07:59:36 +00:00
package.spec.js fix: dynamic date generation for <Package /> component test 2018-06-18 23:49:51 +02:00
packagedetail.spec.js webui snapshot testing 2018-01-07 07:59:36 +00:00
packagelist.spec.js test(e2e): add test scenario to display published packages on ui 2018-02-10 16:45:29 +01:00
readme.spec.js webui snapshot testing 2018-01-07 07:59:36 +00:00
search.spec.js webui: removes function check in search component in test 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>'
    );
    expect(wrapper.html()).toMatchSnapshot();
  });
});