@@ -390,6 +390,19 @@ describe('<Tree />', () => {
390
390
expect . objectContaining ( mockEvt ) ,
391
391
) ;
392
392
} ) ;
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
+ } ) ;
393
406
} ) ;
394
407
395
408
describe ( 'onMouseOver' , ( ) => {
@@ -423,6 +436,19 @@ describe('<Tree />', () => {
423
436
expect . objectContaining ( mockEvt ) ,
424
437
) ;
425
438
} ) ;
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
+ } ) ;
426
452
} ) ;
427
453
428
454
describe ( 'onMouseOut' , ( ) => {
@@ -456,6 +482,19 @@ describe('<Tree />', () => {
456
482
expect . objectContaining ( mockEvt ) ,
457
483
) ;
458
484
} ) ;
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
+ } ) ;
459
498
} ) ;
460
499
461
500
describe ( 'onUpdate' , ( ) => {
0 commit comments