@@ -23,6 +23,7 @@ describe('renderers Expandable', () => {
23
23
collapsed : 'colpased' ,
24
24
} ,
25
25
measure : jest . fn ( ) ,
26
+ index : 1 ,
26
27
} ;
27
28
28
29
const props = { ...baseProps , ...extraProps } ;
@@ -44,23 +45,23 @@ describe('renderers Expandable', () => {
44
45
45
46
expandIconWrapper . simulate ( 'click' ) ;
46
47
47
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
48
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
48
49
} ) ;
49
50
50
51
it ( 'pressing enter should call onChange with the correct params' , ( ) => {
51
52
const { expandIconWrapper, props} = setup ( { expanded : true } ) ;
52
53
53
54
expandIconWrapper . simulate ( 'keyDown' , { keyCode : KEY_CODES . Enter } ) ;
54
55
55
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
56
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
56
57
} ) ;
57
58
58
59
it ( 'double clicking in the parent node should call onChange with the correct params' , ( ) => {
59
60
const { props, wrapper} = setup ( { expanded : true } ) ;
60
61
61
62
wrapper . first ( ) . simulate ( 'doubleClick' ) ;
62
63
63
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : false } ) ) ;
64
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : false } ) , index : props . index } ) ;
64
65
} ) ;
65
66
} ) ;
66
67
@@ -76,23 +77,23 @@ describe('renderers Expandable', () => {
76
77
77
78
expandIconWrapper . simulate ( 'click' ) ;
78
79
79
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
80
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
80
81
} ) ;
81
82
82
83
it ( 'pressing enter should call onChange with the correct params' , ( ) => {
83
84
const { expandIconWrapper, props} = setup ( { expanded : false } ) ;
84
85
85
86
expandIconWrapper . simulate ( 'keyDown' , { keyCode : KEY_CODES . Enter } ) ;
86
87
87
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
88
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
88
89
} ) ;
89
90
90
91
it ( 'double clicking in the parent node should call onChange with the correct params' , ( ) => {
91
92
const { props, wrapper} = setup ( { expanded : false } ) ;
92
93
93
94
wrapper . first ( ) . simulate ( 'doubleClick' ) ;
94
95
95
- expect ( props . onChange ) . toHaveBeenCalledWith ( updateNode ( props . node , { expanded : true } ) ) ;
96
+ expect ( props . onChange ) . toHaveBeenCalledWith ( { ... updateNode ( props . node , { expanded : true } ) , index : props . index } ) ;
96
97
} ) ;
97
98
} ) ;
98
99
} ) ;
0 commit comments