@@ -760,4 +760,59 @@ describe('config argument', function() {
760
760
. then ( done ) ;
761
761
} ) ;
762
762
} ) ;
763
+
764
+ describe ( 'scrollZoom:' , function ( ) {
765
+ var gd ;
766
+
767
+ beforeEach ( function ( ) { gd = createGraphDiv ( ) ; } ) ;
768
+
769
+ function plot ( config ) {
770
+ return Plotly . plot ( gd , [ ] , { } , config ) ;
771
+ }
772
+
773
+ it ( 'should fill in scrollZoom default' , function ( done ) {
774
+ plot ( undefined ) . then ( function ( ) {
775
+ expect ( gd . _context . scrollZoom ) . toBe ( 'gl3d+geo+mapbox' ) ;
776
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , mapbox : 1 } ) ;
777
+ } )
778
+ . catch ( failTest )
779
+ . then ( done ) ;
780
+ } ) ;
781
+
782
+ it ( 'should fill in blank scrollZoom value' , function ( done ) {
783
+ plot ( { scrollZoom : null } ) . then ( function ( ) {
784
+ expect ( gd . _context . scrollZoom ) . toBe ( null ) ;
785
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , mapbox : 1 } ) ;
786
+ } )
787
+ . catch ( failTest )
788
+ . then ( done ) ;
789
+ } ) ;
790
+
791
+ it ( 'should honor scrollZoom:true' , function ( done ) {
792
+ plot ( { scrollZoom : true } ) . then ( function ( ) {
793
+ expect ( gd . _context . scrollZoom ) . toBe ( true ) ;
794
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , cartesian : 1 , mapbox : 1 } ) ;
795
+ } )
796
+ . catch ( failTest )
797
+ . then ( done ) ;
798
+ } ) ;
799
+
800
+ it ( 'should honor scrollZoom:false' , function ( done ) {
801
+ plot ( { scrollZoom : false } ) . then ( function ( ) {
802
+ expect ( gd . _context . scrollZoom ) . toBe ( false ) ;
803
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { } ) ;
804
+ } )
805
+ . catch ( failTest )
806
+ . then ( done ) ;
807
+ } ) ;
808
+
809
+ it ( 'should honor scrollZoom flaglist' , function ( done ) {
810
+ plot ( { scrollZoom : 'mapbox+cartesian' } ) . then ( function ( ) {
811
+ expect ( gd . _context . scrollZoom ) . toBe ( 'mapbox+cartesian' ) ;
812
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { mapbox : 1 , cartesian : 1 } ) ;
813
+ } )
814
+ . catch ( failTest )
815
+ . then ( done ) ;
816
+ } ) ;
817
+ } ) ;
763
818
} ) ;
0 commit comments