Skip to content

Commit 7559c17

Browse files
committed
add jasmine tests for stamen and carto - no all caps CARTO
1 parent df3b628 commit 7559c17

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

src/plots/mapbox/constants.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
var requiredVersion = '1.10.1';
44

55
var OSM = '© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>';
6-
var carto = '© <a target="_blank" href="https://carto.com/">CARTO</a>';
7-
var stamen = '© <a target="_blank" href="https://stamen.com">Stamen Design LLC</a>';
6+
var Carto = '© <a target="_blank" href="https://carto.com/">Carto</a>';
7+
var Stamen = '© <a target="_blank" href="https://stamen.com">Stamen Design LLC</a>';
88

99
var stylesNonMapbox = {
1010
'open-street-map': {
@@ -47,7 +47,7 @@ var stylesNonMapbox = {
4747
sources: {
4848
'plotly-carto-positron': {
4949
type: 'raster',
50-
attribution: [carto, OSM].join(' '),
50+
attribution: [Carto, OSM].join(' '),
5151
tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png'],
5252
tileSize: 256
5353
}
@@ -66,7 +66,7 @@ var stylesNonMapbox = {
6666
sources: {
6767
'plotly-carto-darkmatter': {
6868
type: 'raster',
69-
attribution: [carto, OSM].join(' '),
69+
attribution: [Carto, OSM].join(' '),
7070
tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png'],
7171
tileSize: 256
7272
}
@@ -85,7 +85,7 @@ var stylesNonMapbox = {
8585
sources: {
8686
'plotly-stamen-terrain': {
8787
type: 'raster',
88-
attribution: [stamen, OSM].join(' '),
88+
attribution: [Stamen, OSM].join(' '),
8989
tiles: ['https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png'],
9090
tileSize: 256
9191
}
@@ -104,7 +104,7 @@ var stylesNonMapbox = {
104104
sources: {
105105
'plotly-stamen-toner': {
106106
type: 'raster',
107-
attribution: [stamen, OSM].join(' '),
107+
attribution: [Stamen, OSM].join(' '),
108108
tiles: ['https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png'],
109109
tileSize: 256
110110
}
@@ -123,7 +123,7 @@ var stylesNonMapbox = {
123123
sources: {
124124
'plotly-stamen-watercolor': {
125125
type: 'raster',
126-
attribution: [stamen, OSM].join(' '),
126+
attribution: [Stamen, OSM].join(' '),
127127
tiles: ['https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'],
128128
tileSize: 256
129129
}

test/jasmine/tests/mapbox_test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,26 @@ describe('mapbox plots', function() {
14711471
}, LONG_TIMEOUT_INTERVAL);
14721472

14731473
describe('attributions', function() {
1474+
it('@gl should be displayed for style "Carto"', function(done) {
1475+
Plotly.newPlot(gd, [{type: 'scattermapbox'}], {mapbox: {style: 'carto-darkmatter'}})
1476+
.then(function() {
1477+
var s = d3SelectAll('.mapboxgl-ctrl-attrib');
1478+
expect(s.size()).toBe(1);
1479+
expect(s.text()).toEqual('© Carto © OpenStreetMap');
1480+
})
1481+
.then(done, done.fail);
1482+
});
1483+
1484+
it('@gl should be displayed for style "Stamen"', function(done) {
1485+
Plotly.newPlot(gd, [{type: 'scattermapbox'}], {mapbox: {style: 'stamen-terrain'}})
1486+
.then(function() {
1487+
var s = d3SelectAll('.mapboxgl-ctrl-attrib');
1488+
expect(s.size()).toBe(1);
1489+
expect(s.text()).toEqual('© Stamen Design LLC © OpenStreetMap');
1490+
})
1491+
.then(done, done.fail);
1492+
});
1493+
14741494
it('@gl should be displayed for style "open-street-map"', function(done) {
14751495
Plotly.newPlot(gd, [{type: 'scattermapbox'}], {mapbox: {style: 'open-street-map'}})
14761496
.then(function() {

0 commit comments

Comments
 (0)