Ivan - Frontend - Fix tests [skip ci]
This commit is contained in:
parent
c737c7a9a1
commit
f7093b04d9
|
@ -3,7 +3,7 @@ const Checkbox = ReactMock();
|
|||
const DropDown = ReactMock();
|
||||
const TextEditor = ReactMock();
|
||||
|
||||
const RichTextEditorMock = require('react-rte-browserify');
|
||||
const RichTextEditor = require('react-rte-browserify');
|
||||
|
||||
const FormField = requireUnit('core-components/form-field', {
|
||||
'core-components/input': Input,
|
||||
|
@ -35,7 +35,7 @@ describe('FormField component', function () {
|
|||
expect(FormField.getDefaultValue('input')).to.equal('');
|
||||
expect(FormField.getDefaultValue('checkbox')).to.equal(false);
|
||||
expect(FormField.getDefaultValue('select')).to.equal(0);
|
||||
expect(FormField.getDefaultValue('textarea') instanceof RichTextEditorMock.EditorValue).to.equal(true);
|
||||
expect(FormField.getDefaultValue('textarea') instanceof RichTextEditor.EditorValue).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// MOCKS
|
||||
const ValidationFactoryMock = require('lib-app/__mocks__/validations/validation-factory-mock');
|
||||
const FormField = ReactMock();
|
||||
const RichTextEditorMock = require('react-rte-browserify');
|
||||
const RichTextEditor = require('react-rte-browserify');
|
||||
|
||||
// COMPONENT
|
||||
const Form = requireUnit('core-components/form', {
|
||||
|
@ -186,8 +186,8 @@ describe('Form component', function () {
|
|||
expect(form.props.onSubmit).to.not.have.been.called;
|
||||
});
|
||||
|
||||
it('should tranform EditorState to HTML usign draft-js-export-html library', function () {
|
||||
form.state.form.first = RichTextEditorMock.createEmptyValue();
|
||||
it('should tranform RichTextEditor value to HTML', function () {
|
||||
form.state.form.first = RichTextEditor.createEmptyValue();
|
||||
form.state.form.first.toString = stub().returns('HTML_CODE');
|
||||
|
||||
TestUtils.Simulate.submit(ReactDOM.findDOMNode(form));
|
||||
|
|
Loading…
Reference in New Issue