File tree 2 files changed +19
-5
lines changed 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -424,9 +424,23 @@ Formsy.Form = React.createClass({
424
424
this . validateForm ( ) ;
425
425
} ,
426
426
render : function ( ) {
427
+ var {
428
+ mapping,
429
+ validationErrors,
430
+ onSubmit,
431
+ onValid,
432
+ onInvalid,
433
+ onInvalidSubmit,
434
+ onChange,
435
+ reset,
436
+ preventExternalInvalidation,
437
+ onSuccess,
438
+ onError,
439
+ ...nonFormsyProps
440
+ } = this . props ;
427
441
428
442
return (
429
- < form { ...this . props } onSubmit = { this . submit } >
443
+ < form { ...nonFormsyProps } onSubmit = { this . submit } >
430
444
{ this . props . children }
431
445
</ form >
432
446
) ;
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ export default {
350
350
351
351
} ,
352
352
353
- 'should trigger onChange when form element is changed' : function ( test ) {
353
+ 'should trigger onChange once when form element is changed' : function ( test ) {
354
354
355
355
const hasChanged = sinon . spy ( ) ;
356
356
const form = TestUtils . renderIntoDocument (
@@ -359,12 +359,12 @@ export default {
359
359
</ Formsy . Form >
360
360
) ;
361
361
TestUtils . Simulate . change ( TestUtils . findRenderedDOMComponentWithTag ( form , 'INPUT' ) , { target : { value : 'bar' } } ) ;
362
- test . equal ( hasChanged . called , true ) ;
362
+ test . equal ( hasChanged . calledOnce , true ) ;
363
363
test . done ( ) ;
364
364
365
365
} ,
366
366
367
- 'should trigger onChange when new input is added to form' : function ( test ) {
367
+ 'should trigger onChange once when new input is added to form' : function ( test ) {
368
368
369
369
const hasChanged = sinon . spy ( ) ;
370
370
const TestForm = React . createClass ( {
@@ -394,7 +394,7 @@ export default {
394
394
const form = TestUtils . renderIntoDocument ( < TestForm /> ) ;
395
395
form . addInput ( ) ;
396
396
immediate ( ( ) => {
397
- test . equal ( hasChanged . called , true ) ;
397
+ test . equal ( hasChanged . calledOnce , true ) ;
398
398
test . done ( ) ;
399
399
} ) ;
400
400
You can’t perform that action at this time.
0 commit comments