@@ -5,7 +5,8 @@ var Plots = require('@src/plots/plots');
5
5
var Lib = require ( '@src/lib' ) ;
6
6
var Loggers = require ( '@src/lib/loggers' ) ;
7
7
var Axes = require ( '@src/plots/cartesian/axes' ) ;
8
- var constants = require ( '@src/plots/cartesian/constants' ) ;
8
+ var HOVERMINTIME = require ( '@src/plots/cartesian/constants' ) . HOVERMINTIME ;
9
+ var DBLCLICKDELAY = require ( '@src/constants/interactions' ) . DBLCLICKDELAY ;
9
10
10
11
var d3 = require ( 'd3' ) ;
11
12
var customMatchers = require ( '../assets/custom_matchers' ) ;
@@ -1095,8 +1096,8 @@ describe('annotation effects', function() {
1095
1096
mouseEvent ( 'mouseout' , pos [ 0 ] , pos [ 1 ] ) ;
1096
1097
mouseEvent ( 'mousemove' , 0 , 0 ) ;
1097
1098
1098
- setTimeout ( resolve , constants . HOVERMINTIME ) ;
1099
- } , constants . HOVERMINTIME ) ;
1099
+ setTimeout ( resolve , HOVERMINTIME * 1.1 ) ;
1100
+ } , HOVERMINTIME * 1.1 ) ;
1100
1101
} ) ;
1101
1102
}
1102
1103
@@ -1106,11 +1107,13 @@ describe('annotation effects', function() {
1106
1107
// so we only have to explicitly include pos0-2
1107
1108
spec . push ( [ pos0Head , '' ] ) ;
1108
1109
spec . push ( [ pos2Head , '' ] ) ;
1109
- var p = Promise . resolve ( ) ;
1110
- spec . forEach ( function ( speci , i ) {
1110
+ var p = new Promise ( function ( resolve ) {
1111
+ setTimeout ( resolve , HOVERMINTIME ) ;
1112
+ } ) ;
1113
+ spec . forEach ( function ( speci ) {
1111
1114
p = p . then ( function ( ) {
1112
1115
return assertHoverLabel ( speci [ 0 ] , speci [ 1 ] ,
1113
- msg ? msg + ' (' + i + ')' : i ) ;
1116
+ msg ? msg + ' (' + speci + ')' : speci ) ;
1114
1117
} ) ;
1115
1118
} ) ;
1116
1119
return p ;
@@ -1122,7 +1125,7 @@ describe('annotation effects', function() {
1122
1125
1123
1126
setTimeout ( function ( ) {
1124
1127
resolve ( ) ;
1125
- } , constants . HOVERMINTIME ) ;
1128
+ } , DBLCLICKDELAY * 1.1 ) ;
1126
1129
} ) ;
1127
1130
}
1128
1131
@@ -1132,7 +1135,7 @@ describe('annotation effects', function() {
1132
1135
}
1133
1136
1134
1137
makePlot ( [
1135
- { x : 50 , y : 50 , text : 'hi' , width : 50 , ax : 0 , ay : - 40 , xshift : - 50 , yshift : 50 } ,
1138
+ { x : 50 , y : 50 , text : 'hi' , width : 50 , height : 40 , ax : 0 , ay : - 40 , xshift : - 50 , yshift : 50 } ,
1136
1139
{ x : 20 , y : 20 , text : 'bye' , height : 40 , showarrow : false } ,
1137
1140
{ x : 80 , y : 80 , text : 'why?' , ax : 0 , ay : - 40 }
1138
1141
] , { } ) // turn off the default editable: true
0 commit comments