Skip to content

Commit 9448c8f

Browse files
committed
geo.visible should honor template.layout.geo.show* defaults
when template.layout.geo.visible is set to false, and does NOT set layout.geo.visible template
1 parent 75d3e7d commit 9448c8f

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

test/jasmine/tests/geo_test.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff 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

745795
describe('geojson / topojson utils', function() {

0 commit comments

Comments
 (0)