@@ -1727,24 +1727,26 @@ describe('ModeBar', function() {
1727
1727
. then ( done , done . fail ) ;
1728
1728
} ) ;
1729
1729
1730
- it ( 'add button if removed by layout and added by config' , function ( done ) {
1731
- function countButtons ( ) {
1732
- var modeBarEl = gd . _fullLayout . _modeBar . element ;
1733
- return d3Select ( modeBarEl ) . selectAll ( 'a.modebar-btn' ) . size ( ) ;
1734
- }
1735
-
1736
- var initial = 10 ;
1737
- Plotly . newPlot ( gd , [ { y : [ 1 , 2 ] } ] , {
1738
- modebar : {
1739
- remove : 'zoom'
1730
+ [ 'zoom' , 'zoomin' , 'zoomOut' ] . forEach ( function ( t ) {
1731
+ it ( 'add ' + t + ' button if removed by layout and added by config' , function ( done ) {
1732
+ function countButtons ( ) {
1733
+ var modeBarEl = gd . _fullLayout . _modeBar . element ;
1734
+ return d3Select ( modeBarEl ) . selectAll ( 'a.modebar-btn' ) . size ( ) ;
1740
1735
}
1741
- } , {
1742
- modeBarButtonsToAdd : [ 'zoom' ]
1743
- } )
1744
- . then ( function ( ) {
1745
- expect ( countButtons ( ) ) . toBe ( initial ) ;
1746
- } )
1747
- . then ( done , done . fail ) ;
1736
+
1737
+ var initial = 10 ;
1738
+ Plotly . newPlot ( gd , [ { y : [ 1 , 2 ] } ] , {
1739
+ modebar : {
1740
+ remove : t
1741
+ }
1742
+ } , {
1743
+ modeBarButtonsToAdd : [ t ]
1744
+ } )
1745
+ . then ( function ( ) {
1746
+ expect ( countButtons ( ) ) . toBe ( initial ) ;
1747
+ } )
1748
+ . then ( done , done . fail ) ;
1749
+ } ) ;
1748
1750
} ) ;
1749
1751
1750
1752
it ( 'remove button if added by layout and removed by config' , function ( done ) {
0 commit comments