@@ -760,4 +760,61 @@ 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
+ afterEach ( destroyGraphDiv ) ;
770
+
771
+ function plot ( config ) {
772
+ return Plotly . plot ( gd , [ ] , { } , config ) ;
773
+ }
774
+
775
+ it ( 'should fill in scrollZoom default' , function ( done ) {
776
+ plot ( undefined ) . then ( function ( ) {
777
+ expect ( gd . _context . scrollZoom ) . toBe ( 'gl3d+geo+mapbox' ) ;
778
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , mapbox : 1 } ) ;
779
+ } )
780
+ . catch ( failTest )
781
+ . then ( done ) ;
782
+ } ) ;
783
+
784
+ it ( 'should fill in blank scrollZoom value' , function ( done ) {
785
+ plot ( { scrollZoom : null } ) . then ( function ( ) {
786
+ expect ( gd . _context . scrollZoom ) . toBe ( null ) ;
787
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , mapbox : 1 } ) ;
788
+ } )
789
+ . catch ( failTest )
790
+ . then ( done ) ;
791
+ } ) ;
792
+
793
+ it ( 'should honor scrollZoom:true' , function ( done ) {
794
+ plot ( { scrollZoom : true } ) . then ( function ( ) {
795
+ expect ( gd . _context . scrollZoom ) . toBe ( true ) ;
796
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { gl3d : 1 , geo : 1 , cartesian : 1 , mapbox : 1 } ) ;
797
+ } )
798
+ . catch ( failTest )
799
+ . then ( done ) ;
800
+ } ) ;
801
+
802
+ it ( 'should honor scrollZoom:false' , function ( done ) {
803
+ plot ( { scrollZoom : false } ) . then ( function ( ) {
804
+ expect ( gd . _context . scrollZoom ) . toBe ( false ) ;
805
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { } ) ;
806
+ } )
807
+ . catch ( failTest )
808
+ . then ( done ) ;
809
+ } ) ;
810
+
811
+ it ( 'should honor scrollZoom flaglist' , function ( done ) {
812
+ plot ( { scrollZoom : 'mapbox+cartesian' } ) . then ( function ( ) {
813
+ expect ( gd . _context . scrollZoom ) . toBe ( 'mapbox+cartesian' ) ;
814
+ expect ( gd . _context . _scrollZoom ) . toEqual ( { mapbox : 1 , cartesian : 1 } ) ;
815
+ } )
816
+ . catch ( failTest )
817
+ . then ( done ) ;
818
+ } ) ;
819
+ } ) ;
763
820
} ) ;
0 commit comments