@@ -23,6 +23,7 @@ describe('renderers Expandable', () => {
2323 collapsed : 'colpased' ,
2424 } ,
2525 measure : jest . fn ( ) ,
26+ index : 1 ,
2627 } ;
2728
2829 const props = { ...baseProps , ...extraProps } ;
@@ -44,23 +45,23 @@ describe('renderers Expandable', () => {
4445
4546 expandIconWrapper . simulate ( 'click' ) ;
4647
47- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
48+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
4849 } ) ;
4950
5051 it ( 'pressing enter should call onChange with the correct params' , ( ) => {
5152 const { expandIconWrapper, props} = setup ( { expanded : true } ) ;
5253
5354 expandIconWrapper . simulate ( 'keyDown' , { keyCode : KEY_CODES . Enter } ) ;
5455
55- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
56+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
5657 } ) ;
5758
5859 it ( 'double clicking in the parent node should call onChange with the correct params' , ( ) => {
5960 const { props, wrapper} = setup ( { expanded : true } ) ;
6061
6162 wrapper . first ( ) . simulate ( 'doubleClick' ) ;
6263
63- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
64+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
6465 } ) ;
6566 } ) ;
6667
@@ -76,23 +77,23 @@ describe('renderers Expandable', () => {
7677
7778 expandIconWrapper . simulate ( 'click' ) ;
7879
79- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
80+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
8081 } ) ;
8182
8283 it ( 'pressing enter should call onChange with the correct params' , ( ) => {
8384 const { expandIconWrapper, props} = setup ( { expanded : false } ) ;
8485
8586 expandIconWrapper . simulate ( 'keyDown' , { keyCode : KEY_CODES . Enter } ) ;
8687
87- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
88+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
8889 } ) ;
8990
9091 it ( 'double clicking in the parent node should call onChange with the correct params' , ( ) => {
9192 const { props, wrapper} = setup ( { expanded : false } ) ;
9293
9394 wrapper . first ( ) . simulate ( 'doubleClick' ) ;
9495
95- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
96+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
9697 } ) ;
9798 } ) ;
9899 } ) ;
0 commit comments