File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -708,15 +708,15 @@ describe('Form.Validate', () => {
708708 </ div > ,
709709 ) ;
710710
711- async function changeEmptyValue ( input : HTMLElement ) {
711+ async function changeInputValue ( input : HTMLElement , value = '' ) {
712712 fireEvent . change ( input , {
713713 target : {
714714 value : '2' ,
715715 } ,
716716 } ) ;
717717 fireEvent . change ( input , {
718718 target : {
719- value : '' ,
719+ value,
720720 } ,
721721 } ) ;
722722
@@ -725,7 +725,7 @@ describe('Form.Validate', () => {
725725 } ) ;
726726 }
727727
728- await changeEmptyValue ( container . querySelector ( 'input' ) ) ;
728+ await changeInputValue ( container . querySelector ( 'input' ) ) ;
729729
730730 try {
731731 await form . validateFields ( [ [ 'username' ] ] , { recursive : true } ) ;
@@ -741,6 +741,13 @@ describe('Form.Validate', () => {
741741 await act ( async ( ) => {
742742 await timeout ( ) ;
743743 } ) ;
744+
745+ // Passed
746+ await changeInputValue ( container . querySelectorAll ( 'input' ) [ 0 ] , 'do' ) ;
747+ await changeInputValue ( container . querySelectorAll ( 'input' ) [ 1 ] , 'list' ) ;
748+
749+ const passedValues = await form . validateFields ( [ [ 'username' ] ] , { recursive : true } ) ;
750+ expect ( passedValues ) . toEqual ( { username : { do : 'do' , list : 'list' } } ) ;
744751 } ) ;
745752
746753 it ( 'not trigger validator' , async ( ) => {
You can’t perform that action at this time.
0 commit comments