Skip to content

Commit 12ff323

Browse files
committed
adapt jasmine test to new box/violin autorange vals
1 parent 7c98ae0 commit 12ff323

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

Diff for: test/jasmine/tests/box_test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ describe('Test box hover:', function() {
240240
trace.hoveron = 'points';
241241
});
242242
fig.layout.hovermode = 'closest';
243+
fig.layout.xaxis = {range: [-0.565, 1.5]};
243244
return fig;
244245
},
245246
nums: '(day 1, 0.7)',
@@ -252,6 +253,7 @@ describe('Test box hover:', function() {
252253
trace.hoveron = 'points';
253254
});
254255
fig.layout.hovermode = 'x';
256+
fig.layout.xaxis = {range: [-0.565, 1.5]};
255257
return fig;
256258
},
257259
nums: '0.7',
@@ -265,6 +267,7 @@ describe('Test box hover:', function() {
265267
trace.hoveron = 'points+boxes';
266268
});
267269
fig.layout.hovermode = 'x';
270+
fig.layout.xaxis = {range: [-0.565, 1.5]};
268271
return fig;
269272
},
270273
pos: [215, 200],
@@ -294,6 +297,7 @@ describe('Test box hover:', function() {
294297
trace.text = trace.y.map(function(v) { return 'look:' + v; });
295298
});
296299
fig.layout.hovermode = 'closest';
300+
fig.layout.xaxis = {range: [-0.565, 1.5]};
297301
return fig;
298302
},
299303
nums: '(day 1, 0.7)\nlook:0.7',
@@ -308,6 +312,7 @@ describe('Test box hover:', function() {
308312
trace.hoverinfo = 'text';
309313
});
310314
fig.layout.hovermode = 'closest';
315+
fig.layout.xaxis = {range: [-0.565, 1.5]};
311316
return fig;
312317
},
313318
nums: 'look:0.7',
@@ -426,7 +431,7 @@ describe('Test box restyle:', function() {
426431
});
427432
})
428433
.then(function() {
429-
_assert('auto rng / all boxpoints', [-0.695, 0.5], [-0.555, 10.555]);
434+
_assert('auto rng / all boxpoints', [-0.5055, 0.5], [-0.555, 10.555]);
430435
return Plotly.restyle(gd, 'boxpoints', false);
431436
})
432437
.then(function() {

Diff for: test/jasmine/tests/cartesian_interact_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ describe('main plot pan', function() {
7777
var mock = require('@mocks/10.json');
7878
var precision = 5;
7979

80-
var originalX = [-0.6225, 5.5];
80+
var originalX = [-0.5251046025104602, 5.5];
8181
var originalY = [-1.6340975059013805, 7.166241526218911];
8282

83-
var newX = [-2.0255729166666665, 4.096927083333333];
83+
var newX = [-1.905857740585774, 4.119246861924687];
8484
var newY = [-0.3769062155984817, 8.42343281652181];
8585

8686
function _drag(x0, y0, x1, y1) {

Diff for: test/jasmine/tests/select_test.js

+1
Original file line numberDiff line numberDiff line change
@@ -2294,6 +2294,7 @@ describe('Test select box and lasso per trace:', function() {
22942294
fig.layout.dragmode = 'lasso';
22952295
fig.layout.width = 600;
22962296
fig.layout.height = 500;
2297+
fig.layout.xaxis = {range: [-0.565, 1.5]};
22972298
addInvisible(fig);
22982299

22992300
Plotly.plot(gd, fig)

Diff for: test/jasmine/tests/violin_test.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ describe('Test violin hover:', function() {
499499
patch: function(fig) {
500500
fig.data[0].x = fig.data[0].y;
501501
delete fig.data[0].y;
502-
fig.layout = {hovermode: 'closest'};
502+
fig.layout = {
503+
hovermode: 'closest',
504+
yaxis: {range: [-0.696, 0.5]}
505+
};
503506
return fig;
504507
},
505508
pos: [539, 293],
@@ -550,7 +553,7 @@ describe('Test violin hover:', function() {
550553

551554
Plotly.plot(gd, fig).then(function() {
552555
mouseEvent('mousemove', 300, 250);
553-
assertViolinHoverLine([190.1662826538086, 250, 96.19, 250]);
556+
assertViolinHoverLine([277.3609, 250, 80, 250]);
554557
})
555558
.catch(failTest)
556559
.then(done);
@@ -561,7 +564,7 @@ describe('Test violin hover:', function() {
561564

562565
Plotly.plot(gd, fig).then(function() {
563566
mouseEvent('mousemove', 200, 250);
564-
assertViolinHoverLine([309.83372497558594, 250, 403.81, 250]);
567+
assertViolinHoverLine([222.6391, 250, 420, 250]);
565568
})
566569
.catch(failTest)
567570
.then(done);

0 commit comments

Comments
 (0)