File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -567,6 +567,31 @@ describe('<CheckboxTree />', () => {
567567 } ) ;
568568
569569 describe ( 'onExpand' , ( ) => {
570+ it ( 'should toggle the expansion state of the target node' , ( ) => {
571+ let actualExpanded = null ;
572+
573+ const wrapper = mount (
574+ < CheckboxTree
575+ nodes = { [
576+ {
577+ value : 'jupiter' ,
578+ label : 'Jupiter' ,
579+ children : [
580+ { value : 'io' , label : 'Io' } ,
581+ { value : 'europa' , label : 'Europa' } ,
582+ ] ,
583+ } ,
584+ ] }
585+ onExpand = { ( expanded ) => {
586+ actualExpanded = expanded ;
587+ } }
588+ /> ,
589+ ) ;
590+
591+ wrapper . find ( 'TreeNode Button.rct-collapse-btn' ) . simulate ( 'click' ) ;
592+ assert . deepEqual ( [ 'jupiter' ] , actualExpanded ) ;
593+ } ) ;
594+
570595 it ( 'should pass the node toggled as the second parameter' , ( ) => {
571596 let actualNode = null ;
572597
You can’t perform that action at this time.
0 commit comments