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', () => {
708
708
</ div > ,
709
709
) ;
710
710
711
- async function changeEmptyValue ( input : HTMLElement ) {
711
+ async function changeInputValue ( input : HTMLElement , value = '' ) {
712
712
fireEvent . change ( input , {
713
713
target : {
714
714
value : '2' ,
715
715
} ,
716
716
} ) ;
717
717
fireEvent . change ( input , {
718
718
target : {
719
- value : '' ,
719
+ value,
720
720
} ,
721
721
} ) ;
722
722
@@ -725,7 +725,7 @@ describe('Form.Validate', () => {
725
725
} ) ;
726
726
}
727
727
728
- await changeEmptyValue ( container . querySelector ( 'input' ) ) ;
728
+ await changeInputValue ( container . querySelector ( 'input' ) ) ;
729
729
730
730
try {
731
731
await form . validateFields ( [ [ 'username' ] ] , { recursive : true } ) ;
@@ -741,6 +741,13 @@ describe('Form.Validate', () => {
741
741
await act ( async ( ) => {
742
742
await timeout ( ) ;
743
743
} ) ;
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' } } ) ;
744
751
} ) ;
745
752
746
753
it ( 'not trigger validator' , async ( ) => {
You can’t perform that action at this time.
0 commit comments