Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42a3ed0

Browse files
committed
test: autosize is backwards-compatible
1 parent 172d81d commit 42a3ed0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/jasmine/tests/config_test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ describe('config argument', function() {
3131
expect(+svg.getAttribute('height')).toBe(height);
3232
}
3333

34+
function compareLayoutAndFullLayout(gd) {
35+
expect(gd.layout.width).toBe(gd._fullLayout.width);
36+
expect(gd.layout.height).toBe(gd._fullLayout.height);
37+
}
38+
3439
function testAutosize(autosize, config, layoutHeight, relayoutHeight, done) {
3540
var layout = {
3641
autosize: autosize,
@@ -47,12 +52,14 @@ describe('config argument', function() {
4752

4853
Plotly.plot(gd, data, layout, config).then(function() {
4954
checkLayoutSize(layoutWidth, layoutHeight);
55+
if(!autosize) compareLayoutAndFullLayout(gd);
5056

5157
container.style.width = containerWidthBeforeRelayout + 'px';
5258
container.style.height = containerHeightBeforeRelayout + 'px';
5359

5460
Plotly.relayout(gd, relayout).then(function() {
5561
checkLayoutSize(relayoutWidth, relayoutHeight);
62+
if(!autosize) compareLayoutAndFullLayout(gd);
5663
done();
5764
});
5865
});

0 commit comments

Comments
 (0)