Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions test/jasmine/tests/annotations_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var Plots = require('@src/plots/plots');
var Lib = require('@src/lib');
var Loggers = require('@src/lib/loggers');
var Axes = require('@src/plots/cartesian/axes');
var constants = require('@src/plots/cartesian/constants');
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
var DBLCLICKDELAY = require('@src/constants/interactions').DBLCLICKDELAY;

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

setTimeout(resolve, constants.HOVERMINTIME);
}, constants.HOVERMINTIME);
setTimeout(resolve, HOVERMINTIME * 1.1);
}, HOVERMINTIME * 1.1);
});
}

Expand All @@ -1106,11 +1107,13 @@ describe('annotation effects', function() {
// so we only have to explicitly include pos0-2
spec.push([pos0Head, '']);
spec.push([pos2Head, '']);
var p = Promise.resolve();
spec.forEach(function(speci, i) {
var p = new Promise(function(resolve) {
setTimeout(resolve, HOVERMINTIME);
});
spec.forEach(function(speci) {
p = p.then(function() {
return assertHoverLabel(speci[0], speci[1],
msg ? msg + ' (' + i + ')' : i);
msg ? msg + ' (' + speci + ')' : speci);
});
});
return p;
Expand All @@ -1122,7 +1125,7 @@ describe('annotation effects', function() {

setTimeout(function() {
resolve();
}, constants.HOVERMINTIME);
}, DBLCLICKDELAY * 1.1);
});
}

Expand All @@ -1132,7 +1135,7 @@ describe('annotation effects', function() {
}

makePlot([
{x: 50, y: 50, text: 'hi', width: 50, ax: 0, ay: -40, xshift: -50, yshift: 50},
{x: 50, y: 50, text: 'hi', width: 50, height: 40, ax: 0, ay: -40, xshift: -50, yshift: 50},
{x: 20, y: 20, text: 'bye', height: 40, showarrow: false},
{x: 80, y: 80, text: 'why?', ax: 0, ay: -40}
], {}) // turn off the default editable: true
Expand Down