File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,28 @@ describe('sankey tests', function() {
482
482
. catch ( failTest )
483
483
. then ( done ) ;
484
484
} ) ;
485
+
486
+ it ( 'should not show labels if hovermode is false' , function ( done ) {
487
+ var gd = createGraphDiv ( ) ;
488
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
489
+
490
+ function _hover ( px , py ) {
491
+ mouseEvent ( 'mousemove' , px , py ) ;
492
+ mouseEvent ( 'mouseover' , px , py ) ;
493
+ Lib . clearThrottle ( ) ;
494
+ }
495
+
496
+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
497
+ return Plotly . relayout ( gd , 'hovermode' , false ) ;
498
+ } )
499
+ . then ( function ( ) {
500
+ _hover ( 404 , 302 ) ;
501
+
502
+ assertNoLabel ( ) ;
503
+ } )
504
+ . catch ( failTest )
505
+ . then ( done ) ;
506
+ } ) ;
485
507
} ) ;
486
508
487
509
describe ( 'Test hover/click event data:' , function ( ) {
@@ -620,3 +642,8 @@ function assertLabel(content, style) {
620
642
fontColor : style [ 4 ]
621
643
} ) ;
622
644
}
645
+
646
+ function assertNoLabel ( ) {
647
+ var g = d3 . selectAll ( '.hovertext' ) ;
648
+ expect ( g [ 0 ] . length ) . toBe ( 0 ) ;
649
+ }
You can’t perform that action at this time.
0 commit comments