Skip to content

Commit 4a9b344

Browse files
committed
more delays in annotation test
most importantly between clicks to avoid autorange
1 parent 93dc743 commit 4a9b344

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/jasmine/tests/annotations_test.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ var Plots = require('@src/plots/plots');
55
var Lib = require('@src/lib');
66
var Loggers = require('@src/lib/loggers');
77
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;
910

1011
var d3 = require('d3');
1112
var customMatchers = require('../assets/custom_matchers');
@@ -1095,8 +1096,8 @@ describe('annotation effects', function() {
10951096
mouseEvent('mouseout', pos[0], pos[1]);
10961097
mouseEvent('mousemove', 0, 0);
10971098

1098-
setTimeout(resolve, constants.HOVERMINTIME * 1.5);
1099-
}, constants.HOVERMINTIME * 1.5);
1099+
setTimeout(resolve, HOVERMINTIME * 1.1);
1100+
}, HOVERMINTIME * 1.1);
11001101
});
11011102
}
11021103

@@ -1106,7 +1107,9 @@ describe('annotation effects', function() {
11061107
// so we only have to explicitly include pos0-2
11071108
spec.push([pos0Head, '']);
11081109
spec.push([pos2Head, '']);
1109-
var p = Promise.resolve();
1110+
var p = new Promise(function(resolve) {
1111+
setTimeout(resolve, HOVERMINTIME);
1112+
});
11101113
spec.forEach(function(speci) {
11111114
p = p.then(function() {
11121115
return assertHoverLabel(speci[0], speci[1],
@@ -1122,7 +1125,7 @@ describe('annotation effects', function() {
11221125

11231126
setTimeout(function() {
11241127
resolve();
1125-
}, constants.HOVERMINTIME);
1128+
}, DBLCLICKDELAY * 1.1);
11261129
});
11271130
}
11281131

0 commit comments

Comments
 (0)