8000 Add test that reproduces bug · plotly/plotly.js@e506f43 · GitHub
[go: up one dir, main page]

Skip to content

Commit e506f43

Browse files
committed
Add test that reproduces bug
1 parent cf6e5db commit e506f43

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/jasmine/tests/axes_test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,25 @@ describe('Test axes', function() {
17961796
'input range, ' + msg + ': ' + ax.range);
17971797
}
17981798

1799+
it('can change _inputDomain on call to react when template is present', function(done) {
1800+
Plotly.newPlot(gd,
1801+
[{z: [[0, 1], [2, 3]], type: 'heatmap'}],
1802+
{ template: {}, xaxis: { domain: [0,1], scaleanchor: 'y' } }
1803+
).then(function() {
1804+
assertRangeDomain('xaxis', [-1.451851851851852,2.4518518518518517], [0, 1], [0, 1]);
1805+
})
1806+
.then(function() {
1807+
return Plotly.react(gd,
1808+
[{z: [[0, 1], [2, 3]], type: 'heatmap'}],
1809+
{ template: {}, xaxis: { domain: [0.1, 0.9] } }
1810+
);
1811+
})
1812+
.then(function() {
1813+
assertRangeDomain('xaxis', [-0.5,1.5], [0.1, 0.9], [0.1, 0.9]);
1814+
})
1815+
.then(done, done.fail);
1816+
});
1817+
17991818
it('can change per-axis constrain:domain/range and constraintoward', function(done) {
18001819
Plotly.newPlot(gd,
18011820
// start with a heatmap as it has no padding so calculations are easy

0 commit comments

Comments
 (0)
0