mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 00:04:31 +02:00
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 DropDown = ReactMock();
|
||||||
const TextEditor = ReactMock();
|
const TextEditor = ReactMock();
|
||||||
|
|
||||||
const RichTextEditorMock = require('react-rte-browserify');
|
const RichTextEditor = require('react-rte-browserify');
|
||||||
|
|
||||||
const FormField = requireUnit('core-components/form-field', {
|
const FormField = requireUnit('core-components/form-field', {
|
||||||
'core-components/input': Input,
|
'core-components/input': Input,
|
||||||
@ -35,7 +35,7 @@ describe('FormField component', function () {
|
|||||||
expect(FormField.getDefaultValue('input')).to.equal('');
|
expect(FormField.getDefaultValue('input')).to.equal('');
|
||||||
expect(FormField.getDefaultValue('checkbox')).to.equal(false);
|
expect(FormField.getDefaultValue('checkbox')).to.equal(false);
|
||||||
expect(FormField.getDefaultValue('select')).to.equal(0);
|
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
|
// MOCKS
|
||||||
const ValidationFactoryMock = require('lib-app/__mocks__/validations/validation-factory-mock');
|
const ValidationFactoryMock = require('lib-app/__mocks__/validations/validation-factory-mock');
|
||||||
const FormField = ReactMock();
|
const FormField = ReactMock();
|
||||||
const RichTextEditorMock = require('react-rte-browserify');
|
const RichTextEditor = require('react-rte-browserify');
|
||||||
|
|
||||||
// COMPONENT
|
// COMPONENT
|
||||||
const Form = requireUnit('core-components/form', {
|
const Form = requireUnit('core-components/form', {
|
||||||
@ -186,8 +186,8 @@ describe('Form component', function () {
|
|||||||
expect(form.props.onSubmit).to.not.have.been.called;
|
expect(form.props.onSubmit).to.not.have.been.called;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should tranform EditorState to HTML usign draft-js-export-html library', function () {
|
it('should tranform RichTextEditor value to HTML', function () {
|
||||||
form.state.form.first = RichTextEditorMock.createEmptyValue();
|
form.state.form.first = RichTextEditor.createEmptyValue();
|
||||||
form.state.form.first.toString = stub().returns('HTML_CODE');
|
form.state.form.first.toString = stub().returns('HTML_CODE');
|
||||||
|
|
||||||
TestUtils.Simulate.submit(ReactDOM.findDOMNode(form));
|
TestUtils.Simulate.submit(ReactDOM.findDOMNode(form));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user