@@ -8,6 +8,7 @@ var Lib = require('@src/lib');
8
8
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
9
9
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
10
10
var mouseEvent = require ( '../assets/mouse_event' ) ;
11
+ var click = require ( '../assets/click' ) ;
11
12
var doubleClick = require ( '../assets/double_click' ) ;
12
13
13
14
describe ( 'hover info' , function ( ) {
@@ -630,6 +631,16 @@ describe('hover after resizing', function() {
630
631
631
632
afterEach ( destroyGraphDiv ) ;
632
633
634
+ function _click ( pos ) {
635
+ return new Promise ( function ( resolve ) {
636
+ click ( pos [ 0 ] , pos [ 1 ] ) ;
637
+
638
+ setTimeout ( function ( ) {
639
+ resolve ( ) ;
640
+ } , constants . HOVERMINTIME ) ;
641
+ } ) ;
642
+ }
643
+
633
644
function assertLabelCount ( pos , cnt , msg ) {
634
645
return new Promise ( function ( resolve ) {
635
646
mouseEvent ( 'mousemove' , pos [ 0 ] , pos [ 1 ] ) ;
@@ -652,6 +663,12 @@ describe('hover after resizing', function() {
652
663
pos1 = [ 401 , 122 ] ;
653
664
654
665
Plotly . plot ( gd , data , layout ) . then ( function ( ) {
666
+
667
+ // to test https://github.com/plotly/plotly.js/issues/1044
668
+
669
+ return _click ( pos0 ) ;
670
+ } )
671
+ . then ( function ( ) {
655
672
return assertLabelCount ( pos0 , 1 , 'before resize, showing pt label' ) ;
656
673
} )
657
674
. then ( function ( ) {
0 commit comments