@@ -8,6 +8,7 @@ var Lib = require('@src/lib');
88var createGraphDiv = require ( '../assets/create_graph_div' ) ;
99var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
1010var mouseEvent = require ( '../assets/mouse_event' ) ;
11+ var click = require ( '../assets/click' ) ;
1112var doubleClick = require ( '../assets/double_click' ) ;
1213
1314describe ( 'hover info' , function ( ) {
@@ -630,6 +631,16 @@ describe('hover after resizing', function() {
630631
631632 afterEach ( destroyGraphDiv ) ;
632633
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+
633644 function assertLabelCount ( pos , cnt , msg ) {
634645 return new Promise ( function ( resolve ) {
635646 mouseEvent ( 'mousemove' , pos [ 0 ] , pos [ 1 ] ) ;
@@ -652,6 +663,12 @@ describe('hover after resizing', function() {
652663 pos1 = [ 401 , 122 ] ;
653664
654665 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 ( ) {
655672 return assertLabelCount ( pos0 , 1 , 'before resize, showing pt label' ) ;
656673 } )
657674 . then ( function ( ) {
0 commit comments