Skip to content

Commit fbe1fb9

Browse files
committed
add jasmine test
1 parent a7ce254 commit fbe1fb9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/jasmine/tests/click_test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,35 @@ describe('Test click interactions:', function() {
10171017
})
10181018
.then(done, done.fail);
10191019
});
1020+
1021+
it('when set to \'reset+autorange\' (the default) should autosize on 1st and 2nd double clicks (case of partial ranges)', function(done) {
1022+
mockCopy = setRanges(mockCopy);
1023+
1024+
Plotly.newPlot(gd, [{
1025+
y: [1, 2, 3, 4]}
1026+
], {
1027+
xaxis: {range: [1, null]},
1028+
yaxis: {range: [null, 3]},
1029+
width: 600,
1030+
height: 600
1031+
}).then(function() {
1032+
expect(gd.layout.xaxis.range).toBeCloseToArray([1, 3.2]);
1033+
expect(gd.layout.yaxis.range).toBeCloseToArray([0.8, 3]);
1034+
1035+
return doubleClick(300, 300);
1036+
})
1037+
.then(function() {
1038+
expect(gd.layout.xaxis.range).toBeCloseToArray([-0.2, 3.2]);
1039+
expect(gd.layout.yaxis.range).toBeCloseToArray([0.8, 4.2]);
1040+
1041+
return doubleClick(300, 300);
1042+
})
1043+
.then(function() {
1044+
expect(gd.layout.xaxis.range).toBeCloseToArray([1, 3.2]);
1045+
expect(gd.layout.yaxis.range).toBeCloseToArray([0.8, 3]);
1046+
})
1047+
.then(done, done.fail);
1048+
});
10201049
});
10211050

10221051
describe('zoom interactions', function() {

0 commit comments

Comments
 (0)