@@ -388,16 +388,16 @@ describe('sankey tests', function() {
388
388
describe ( 'Test hover/click interactions:' , function ( ) {
389
389
afterEach ( destroyGraphDiv ) ;
390
390
391
+ function _hover ( px , py ) {
392
+ mouseEvent ( 'mousemove' , px , py ) ;
393
+ mouseEvent ( 'mouseover' , px , py ) ;
394
+ Lib . clearThrottle ( ) ;
395
+ }
396
+
391
397
it ( 'should show the correct hover labels' , function ( done ) {
392
398
var gd = createGraphDiv ( ) ;
393
399
var mockCopy = Lib . extendDeep ( { } , mock ) ;
394
400
395
- function _hover ( px , py ) {
396
- mouseEvent ( 'mousemove' , px , py ) ;
397
- mouseEvent ( 'mouseover' , px , py ) ;
398
- Lib . clearThrottle ( ) ;
399
- }
400
-
401
401
Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
402
402
_hover ( 404 , 302 ) ;
403
403
@@ -464,12 +464,6 @@ describe('sankey tests', function() {
464
464
var mockCopy = Lib . extendDeep ( { } , mock ) ;
465
465
delete mockCopy . data [ 0 ] . link . label ;
466
466
467
- function _hover ( px , py ) {
468
- mouseEvent ( 'mousemove' , px , py ) ;
469
- mouseEvent ( 'mouseover' , px , py ) ;
470
- Lib . clearThrottle ( ) ;
471
- }
472
-
473
467
Plotly . plot ( gd , mockCopy )
474
468
. then ( function ( ) {
475
469
_hover ( 450 , 300 ) ;
@@ -487,12 +481,6 @@ describe('sankey tests', function() {
487
481
var gd = createGraphDiv ( ) ;
488
482
var mockCopy = Lib . extendDeep ( { } , mock ) ;
489
483
490
- function _hover ( px , py ) {
491
- mouseEvent ( 'mousemove' , px , py ) ;
492
- mouseEvent ( 'mouseover' , px , py ) ;
493
- Lib . clearThrottle ( ) ;
494
- }
495
-
496
484
Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
497
485
return Plotly . relayout ( gd , 'hovermode' , false ) ;
498
486
} )
@@ -645,5 +633,5 @@ function assertLabel(content, style) {
645
633
646
634
function assertNoLabel ( ) {
647
635
var g = d3 . selectAll ( '.hovertext' ) ;
648
- expect ( g [ 0 ] . length ) . toBe ( 0 ) ;
636
+ expect ( g . size ( ) ) . toBe ( 0 ) ;
649
637
}
0 commit comments