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
Juan Picado @jotadeveloper 3639557118
feat: replaced element-react by Material-UI (#950) (#985)
* feat: added material-ui

refactor: replaced element-react by material-ui

refactor: updated snapshots

refactor: updated tests

* fix: modified validation.WIP

* refactor: modified tests.WIP

* test(fix): unit test for login and validat ecredentials

* chore(fix): e2e update css selectors

* test(fix): replace Object.values by supported syntax on node6
2018-09-06 21:26:54 +02:00
..
__mocks__ fix: login without reload (#678) (#679) (#914) 2018-08-20 16:29:47 +02:00
__snapshots__ feat: replaced element-react by Material-UI (#950) (#985) 2018-09-06 21:26:54 +02:00
PackageSidebar chore: add unit test for #857 scenario 2018-07-28 08:45:10 +02: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 feat: replaced element-react by Material-UI (#950) (#985) 2018-09-06 21:26:54 +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 feat: replaced element-react by Material-UI (#950) (#985) 2018-09-06 21:26:54 +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();
  });
});