@@ -135,20 +135,23 @@ describe('Form.Basic', () => {
135135 expect ( form . isFieldTouched ( 'username' ) ) . toBeFalsy ( ) ;
136136 expect ( onError ) . not . toHaveBeenCalled ( ) ;
137137 expect ( onReset ) . toHaveBeenCalled ( ) ;
138+ onError . mockRestore ( ) ;
138139 onReset . mockRestore ( ) ;
139140
140141 await changeValue ( getField ( wrapper , 'username' ) , '' ) ;
141142 expect ( form . getFieldValue ( 'username' ) ) . toEqual ( '' ) ;
142143 expect ( form . getFieldError ( 'username' ) ) . toEqual ( [ "'username' is required" ] ) ;
143144 expect ( form . isFieldTouched ( 'username' ) ) . toBeTruthy ( ) ;
144- expect ( onError ) . toHaveBeenCalledWith ( [ "'username' is required" ] ) ;
145+ expect ( onError ) . toHaveBeenCalledWith ( [ "'username' is required" ] , [ ] ) ;
145146 expect ( onReset ) . not . toHaveBeenCalled ( ) ;
147+ onError . mockRestore ( ) ;
148+ onReset . mockRestore ( ) ;
146149
147150 form . resetFields ( ...args ) ;
148151 expect ( form . getFieldValue ( 'username' ) ) . toEqual ( undefined ) ;
149152 expect ( form . getFieldError ( 'username' ) ) . toEqual ( [ ] ) ;
150153 expect ( form . isFieldTouched ( 'username' ) ) . toBeFalsy ( ) ;
151- expect ( onError ) . toHaveBeenCalledWith ( [ ] ) ;
154+ expect ( onError ) . toHaveBeenCalledWith ( [ ] , [ ] ) ;
152155 expect ( onReset ) . toHaveBeenCalled ( ) ;
153156 } ) ;
154157 }
@@ -287,7 +290,7 @@ describe('Form.Basic', () => {
287290 matchError ( wrapper , "'user' is required" ) ;
288291 expect ( onFinish ) . not . toHaveBeenCalled ( ) ;
289292 expect ( onFinishFailed ) . toHaveBeenCalledWith ( {
290- errorFields : [ { name : [ 'user' ] , errors : [ "'user' is required" ] } ] ,
293+ errorFields : [ { name : [ 'user' ] , errors : [ "'user' is required" ] , warnings : [ ] } ] ,
291294 outOfDate : false ,
292295 values : { } ,
293296 } ) ;
@@ -643,7 +646,7 @@ describe('Form.Basic', () => {
643646
644647 expect (
645648 form . getFieldsValue ( null , meta => {
646- expect ( Object . keys ( meta ) ) . toEqual ( [ 'touched' , 'validating' , 'errors' , 'name' ] ) ;
649+ expect ( Object . keys ( meta ) ) . toEqual ( [ 'touched' , 'validating' , 'errors' , 'warnings' , ' name'] ) ;
647650 return false ;
648651 } ) ,
649652 ) . toEqual ( { } ) ;
0 commit comments