Skip to content

Commit 0e23045

Browse files
committed
test: add case for mapbox style JSON
1 parent 89d16de commit 0e23045

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/jasmine/tests/mapbox_test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ describe('mapbox defaults', function() {
5555
expect(layoutOut.mapbox._input).toBe(mapbox);
5656
});
5757

58+
it('should accept both string and object style', function() {
59+
var mapboxStyleJSON = {
60+
id: 'cdsa213wqdsa',
61+
owner: 'johnny'
62+
};
63+
64+
layoutIn = {
65+
mapbox: { style: 'light' },
66+
mapbox2: { style: mapboxStyleJSON }
67+
};
68+
69+
fullData.push({ type: 'scattermapbox', subplot: 'mapbox2' });
70+
71+
supplyLayoutDefaults(layoutIn, layoutOut, fullData);
72+
expect(layoutOut.mapbox.style).toEqual('light');
73+
expect(layoutOut.mapbox2.style).toBe(mapboxStyleJSON);
74+
});
75+
5876
it('should fill layer containers', function() {
5977
layoutIn = {
6078
mapbox: {

0 commit comments

Comments
 (0)