1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/unit/webui/components
Stéphane Bachelier 9b52b1d396 feat: display package peer deps (#1144)
* feat: enable overriding Dependencies title

* feat: add PeerDependencies component

* test: add PeerDependencies unit tests

* test: add unit test about Dependencies title overriding

* feat: display peer dependencies in package sidebar
2018-12-03 06:41:25 +01:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ fix: click on logo break ui (#1073) 2018-10-13 10:51:24 +02:00
PackageSidebar feat: display package peer deps (#1144) 2018-12-03 06:41:25 +01:00
store fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
footer.spec.js refactor: <Package /> , <Footer /> and package sidebar code refactoring 2018-07-22 21:22:51 +02:00
header.spec.js fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
help.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00
login.spec.js fix: login modal validation (#958) 2018-08-28 08:12:30 +02:00
noitems.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00
notfound.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00
package.spec.js refactor: <Package /> , <Footer /> and package sidebar code refactoring 2018-07-22 21:22:51 +02:00
packagedetail.spec.js refactor: <Package /> , <Footer /> and package sidebar code refactoring 2018-07-22 21:22:51 +02:00
packagelist.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00
readme.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00
search.spec.js refactor: removes un-necessary 'src' from webui path 2018-07-17 22:03:06 +02:00

/**
 * Readme component
 */

import React from 'react';
import { shallow } from 'enzyme';
import Readme from '../../../../src/webui/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();
  });
});