Skip to content

Commit 9c2a0d9

Browse files
committed
test: add test for issue plotly#537
* Added test to check `Plotly.newPlot` respects `layout.width` and `layout.height`.
1 parent 206888b commit 9c2a0d9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/jasmine/tests/plot_api_test.js

+25
Original file line numberDiff line numberDiff line change
@@ -786,4 +786,29 @@ describe('Test plot api', function() {
786786
expect(gd.data[1].contours).toBeUndefined();
787787
});
788788
});
789+
790+
describe('Plotly.newPlot', function() {
791+
var gd;
792+
793+
beforeEach(function() {
794+
gd = createGraphDiv();
795+
});
796+
797+
afterEach(destroyGraphDiv);
798+
799+
it('should respect layout.width and layout.height', function(done) {
800+
801+
// See issue https://github.com/plotly/plotly.js/issues/537
802+
var data = [{
803+
x: [1, 2],
804+
y: [1, 2]
805+
}];
806+
807+
Plotly.plot(gd, data).then(function() {
808+
Plotly.newPlot(gd, data, { height: 50 }).then(function() {
809+
expect(gd._fullLayout.height).toBe(50);
810+
}).then(done);
811+
});
812+
});
813+
});
789814
});

0 commit comments

Comments
 (0)