@@ -390,6 +390,19 @@ describe('<Tree />', () => {
390390 expect . objectContaining ( mockEvt ) ,
391391 ) ;
392392 } ) ;
393+
394+ it ( 'persists the SynthethicEvent for downstream processing' , ( ) => {
395+ const persistSpy = jest . fn ( ) ;
396+ const mockEvt = { mock : 'event' , persist : persistSpy } ;
397+ const renderedComponent = mount ( < Tree data = { mockData } onClick = { ( ) => { } } /> ) ;
398+
399+ renderedComponent
400+ . find ( Node )
401+ . first ( )
402+ . simulate ( 'click' , mockEvt ) ;
403+
404+ expect ( persistSpy ) . toHaveBeenCalledTimes ( 1 ) ;
405+ } ) ;
393406 } ) ;
394407
395408 describe ( 'onMouseOver' , ( ) => {
@@ -423,6 +436,19 @@ describe('<Tree />', () => {
423436 expect . objectContaining ( mockEvt ) ,
424437 ) ;
425438 } ) ;
439+
440+ it ( 'persists the SynthethicEvent for downstream processing if handler is defined' , ( ) => {
441+ const persistSpy = jest . fn ( ) ;
442+ const mockEvt = { mock : 'event' , persist : persistSpy } ;
443+ const renderedComponent = mount ( < Tree data = { mockData } onMouseOver = { ( ) => { } } /> ) ;
444+
445+ renderedComponent
446+ . find ( Node )
447+ . first ( )
448+ . simulate ( 'mouseover' , mockEvt ) ;
449+
450+ expect ( persistSpy ) . toHaveBeenCalledTimes ( 1 ) ;
451+ } ) ;
426452 } ) ;
427453
428454 describe ( 'onMouseOut' , ( ) => {
@@ -456,6 +482,19 @@ describe('<Tree />', () => {
456482 expect . objectContaining ( mockEvt ) ,
457483 ) ;
458484 } ) ;
485+
486+ it ( 'persists the SynthethicEvent for downstream processing if handler is defined' , ( ) => {
487+ const persistSpy = jest . fn ( ) ;
488+ const mockEvt = { mock : 'event' , persist : persistSpy } ;
489+ const renderedComponent = mount ( < Tree data = { mockData } onMouseOut = { ( ) => { } } /> ) ;
490+
491+ renderedComponent
492+ . find ( Node )
493+ . first ( )
494+ . simulate ( 'mouseout' , mockEvt ) ;
495+
496+ expect ( persistSpy ) . toHaveBeenCalledTimes ( 1 ) ;
497+ } ) ;
459498 } ) ;
460499
461500 describe ( 'onUpdate' , ( ) => {
0 commit comments