File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -703,6 +703,34 @@ describe('legend relayout update', function() {
703
703
. then ( done ) ;
704
704
} ) ;
705
705
} ) ;
706
+
707
+ describe ( 'with legendgroup' , function ( ) {
708
+ var mock = require ( '@mocks/legendgroup_horizontal_wrapping.json' ) ;
709
+ var gd ;
710
+
711
+ beforeEach ( function ( ) {
712
+ gd = createGraphDiv ( ) ;
713
+ } ) ;
714
+ afterEach ( destroyGraphDiv ) ;
715
+
716
+ it ( 'changes the margin size to fit tracegroupgap' , function ( done ) {
717
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
718
+ Plotly . newPlot ( gd , mockCopy )
719
+ . then ( function ( ) {
720
+ expect ( gd . _fullLayout . _size . b ) . toBe ( 130 ) ;
721
+ return Plotly . relayout ( gd , 'legend.tracegroupgap' , 70 ) ;
722
+ } )
723
+ . then ( function ( ) {
724
+ expect ( gd . _fullLayout . _size . b ) . toBe ( 185 ) ;
725
+ return Plotly . relayout ( gd , 'legend.tracegroupgap' , 10 ) ;
726
+ } )
727
+ . then ( function ( ) {
728
+ expect ( gd . _fullLayout . _size . b ) . toBe ( 130 ) ;
729
+ } )
730
+ . catch ( failTest )
731
+ . then ( done ) ;
732
+ } ) ;
733
+ } ) ;
706
734
} ) ;
707
735
708
736
describe ( 'legend orientation change:' , function ( ) {
You can’t perform that action at this time.
0 commit comments