mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
webui: <Readme /> component test case
This commit is contained in:
parent
50884dfd7e
commit
b77c0ea7bb
1 changed files with 26 additions and 0 deletions
26
test/webui/components/readme.spec.js
Normal file
26
test/webui/components/readme.spec.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* 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>'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue