File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -786,4 +786,29 @@ describe('Test plot api', function() {
786
786
expect ( gd . data [ 1 ] . contours ) . toBeUndefined ( ) ;
787
787
} ) ;
788
788
} ) ;
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
+ } ) ;
789
814
} ) ;
You can’t perform that action at this time.
0 commit comments