File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -604,10 +604,21 @@ describe('Form.List', () => {
604
604
( fields , operation ) => (
605
605
< div >
606
606
{ fields . map ( field => (
607
- < Field { ...field } key = { field . key } name = { [ field . name , 'first' ] } >
608
- < Input />
609
- </ Field >
607
+ < div key = { field . key } >
608
+ < Field name = { [ field . name , 'first' ] } >
609
+ < Input />
610
+ </ Field >
611
+ < Field name = { [ field . name , 'second' ] } >
612
+ < Input />
613
+ </ Field >
614
+ </ div >
610
615
) ) }
616
+ < button
617
+ type = "button"
618
+ onClick = { ( ) => {
619
+ operation . add ( ) ;
620
+ } }
621
+ />
611
622
< button
612
623
type = "button"
613
624
onClick = { ( ) => {
@@ -619,12 +630,12 @@ describe('Form.List', () => {
619
630
{
620
631
onValuesChange,
621
632
initialValues : {
622
- list : [ { first : 'light' } , { first : 'bamboo' } ] ,
633
+ list : [ { first : 'light' } ] ,
623
634
} ,
624
635
} ,
625
636
) ;
626
-
627
- wrapper . find ( 'button' ) . simulate ( 'click' ) ;
637
+ wrapper . find ( 'button' ) . first ( ) . simulate ( 'click' ) ;
638
+ wrapper . find ( 'button' ) . last ( ) . simulate ( 'click' ) ;
628
639
expect ( onValuesChange ) . toHaveBeenCalledWith ( expect . anything ( ) , { list : [ { first : 'light' } ] } ) ;
629
640
} ) ;
630
641
You can’t perform that action at this time.
0 commit comments