Skip to content

Commit 5b27ea4

Browse files
committed
make drag delay 25% of DBLCLICKDELAY:
- to speed up tests - add overwrite arg (so that double-click + drag test works)
1 parent 97afe67 commit 5b27ea4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/jasmine/tests/click_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('Test click interactions:', function() {
5151
});
5252
}
5353

54-
function drag(fromX, fromY, toX, toY) {
54+
function drag(fromX, fromY, toX, toY, delay) {
5555
return new Promise(function(resolve) {
5656
mouseEvent('mousemove', fromX, fromY);
5757
mouseEvent('mousedown', fromX, fromY);
@@ -60,7 +60,7 @@ describe('Test click interactions:', function() {
6060
setTimeout(function() {
6161
mouseEvent('mouseup', toX, toY);
6262
resolve();
63-
}, DBLCLICKDELAY / 2);
63+
}, delay || DBLCLICKDELAY / 4);
6464
});
6565
}
6666

@@ -213,7 +213,7 @@ describe('Test click interactions:', function() {
213213
expect(gd.layout.xaxis.range).toBeCloseToArray(autoRangeX);
214214
expect(gd.layout.yaxis.range).toBeCloseToArray(autoRangeY);
215215

216-
return drag(100, 100, 200, 200);
216+
return drag(100, 100, 200, 200, DBLCLICKDELAY / 2);
217217
}).then(function() {
218218
expect(gd.layout.xaxis.range).toBeCloseToArray([-2.70624901567643, -1.9783478816352495]);
219219
expect(gd.layout.yaxis.range).toBeCloseToArray([0.5007032802920716, 1.2941670624404753]);

0 commit comments

Comments
 (0)