File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -740,6 +740,56 @@ describe('Test Geo layout defaults', function() {
740740 } ) ;
741741 } ) ;
742742 } ) ;
743+
744+ describe ( [
745+ 'geo.visible should honor template.layout.geo.show* defaults' ,
746+ 'when template.layout.geo.visible is set to false,' ,
747+ 'and does NOT set layout.geo.visible template'
748+ ] . join ( ' ' ) , function ( ) {
749+ var keys = [
750+ 'lonaxis.showgrid' ,
751+ 'lataxis.showgrid' ,
752+ 'showcoastlines' ,
753+ 'showocean' ,
754+ 'showland' ,
755+ 'showlakes' ,
756+ 'showrivers' ,
757+ 'showcountries' ,
758+ 'showsubunits' ,
759+ 'showframe'
760+ ] ;
761+
762+ function _assert ( extra ) {
763+ var geo = layoutOut . geo ;
764+ keys . forEach ( function ( k ) {
765+ var actual = Lib . nestedProperty ( geo , k ) . get ( ) ;
766+ if ( extra && k in extra ) {
767+ expect ( actual ) . toBe ( extra [ k ] , k ) ;
768+ } else {
769+ expect ( actual ) . toBe ( false , k ) ;
770+ }
771+ } ) ;
772+ }
773+
774+ it ( '- disable geo.visible via template' , function ( ) {
775+ layoutIn = {
776+ template : {
777+ layout : {
778+ geo : {
779+ visible : false
780+ }
781+ }
782+ }
783+ } ;
784+
785+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
786+ _assert ( {
787+ showcoastlines : true ,
788+ showframe : true ,
789+ showsubunits : undefined
790+ } ) ;
791+ } ) ;
792+ } ) ;
743793} ) ;
744794
745795describe ( 'geojson / topojson utils' , function ( ) {
You can’t perform that action at this time.
0 commit comments