Skip to content

Commit b40a3a0

Browse files
prushforprushforth
authored andcommitted
Change uppercase / lowercase comparison to compare projection strings
without folding add a few waitForTimeout() after zoom to fix the flaky multipleQueryExtent test
1 parent d8729c8 commit b40a3a0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/mapml/layers/MapMLLayer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ export var MapMLLayer = L.Layer.extend({
257257
}
258258
}
259259
}
260-
return !(
261-
noLayer || this.getProjection() !== map.options.projection.toUpperCase()
262-
);
260+
return !(noLayer || this.getProjection() !== map.options.projection);
263261
},
264262

265263
//sets the <layer-> elements .bounds property
@@ -906,7 +904,7 @@ export var MapMLLayer = L.Layer.extend({
906904
mapml
907905
.querySelector('map-meta[name=projection]')
908906
.getAttribute('content')
909-
).content.toUpperCase() || projection;
907+
).content || projection;
910908
} else if (mapml.querySelector('map-extent[units]')) {
911909
const getProjectionFrom = (extents) => {
912910
let extentProj = extents[0].attributes.units.value;

test/e2e/layers/multipleQueryExtents.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ test.describe('Multiple Extent Query Tests', () => {
114114
await page.evaluateHandle(() =>
115115
document.querySelector('mapml-viewer').zoomTo(10, 5, 0)
116116
);
117+
await page.waitForTimeout(300);
117118
await page.click('div');
118119
await page.waitForSelector(
119120
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div'
@@ -162,6 +163,7 @@ test.describe('Multiple Extent Query Tests', () => {
162163
await page.evaluateHandle(() =>
163164
document.querySelector('mapml-viewer').zoomTo(-18, 5, 0)
164165
);
166+
await page.waitForTimeout(300);
165167
await page.click('div');
166168
await page.waitForSelector(
167169
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div',
@@ -175,6 +177,7 @@ test.describe('Multiple Extent Query Tests', () => {
175177
await page.evaluateHandle(() =>
176178
document.querySelector('mapml-viewer').zoomTo(-16, -40, 0)
177179
);
180+
await page.waitForTimeout(300);
178181
await page.click('div');
179182
const popupNumBottom = await page.$eval(
180183
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane',
@@ -184,6 +187,7 @@ test.describe('Multiple Extent Query Tests', () => {
184187
await page.evaluateHandle(() =>
185188
document.querySelector('mapml-viewer').zoomTo(33, -170, 0)
186189
);
190+
await page.waitForTimeout(300);
187191
await page.click('div');
188192
const popupNumLeft = await page.$eval(
189193
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane',
@@ -193,6 +197,7 @@ test.describe('Multiple Extent Query Tests', () => {
193197
await page.evaluateHandle(() =>
194198
document.querySelector('mapml-viewer').zoomTo(30, 98, 0)
195199
);
200+
await page.waitForTimeout(300);
196201
await page.click('div');
197202
const popupNumTop = await page.$eval(
198203
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane',

0 commit comments

Comments
 (0)