Skip to content

Commit 1640740

Browse files
committed
Adjusted to pass failing tests
1 parent 6531b70 commit 1640740

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/map-properties.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export class HTMLPropertiesElement extends HTMLElement {
99
super();
1010
}
1111
connectedCallback() {
12-
this._popupDiv = document.createElement('div');
13-
this._popupDiv.classList.add('mapml-popup-content');
14-
this._popupDiv.insertAdjacentHTML('afterbegin', properties.innerHTML);
12+
// this._popupDiv = document.createElement('div');
13+
// this._popupDiv.classList.add('mapml-popup-content');
14+
// this._popupDiv.insertAdjacentHTML('afterbegin', properties.innerHTML);
1515
}
1616
test() {
1717
console.log('test');

src/mapml-viewer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export class HTMLMapmlViewerElement extends HTMLElement {
210210
this._changeHeight(h);
211211

212212
this._createMap();
213+
this._setPopupHeight();
213214

214215
// https://github.com/Maps4HTML/MapML.js/issues/274
215216
this.setAttribute('role', 'application');
@@ -330,7 +331,6 @@ export class HTMLMapmlViewerElement extends HTMLElement {
330331
this._createControls();
331332
this._toggleControls();
332333
this._crosshair = crosshair().addTo(this._map);
333-
this._setPopupHeight();
334334

335335
if (M.options.featureIndexOverlayOption)
336336
this._featureIndexOverlay = featureIndexOverlay().addTo(this._map);
@@ -670,7 +670,7 @@ export class HTMLMapmlViewerElement extends HTMLElement {
670670
const rootHeight = this._container.offsetHeight;
671671
// Set popup content height as a percentage of root height
672672
this._popupHeight = `${rootHeight * 0.5}px`; // Adjust 0.8 to the desired ratio
673-
popupContentDiv.style.overflowY = 'auto'; // Add scrolling if content overflows
673+
// popupContentDiv.style.overflowY = 'auto'; // Add scrolling if content overflows
674674
}
675675
}
676676
_setUpEvents() {

test/e2e/layers/queryLink.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ test.describe('Playwright Query Link Tests', () => {
108108
(iframe) => iframe.contentWindow.document.querySelector('h1').innerText
109109
);
110110
const href = await page.$eval(
111-
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > div > a.mapml-zoom-link',
111+
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > a.mapml-zoom-link',
112112
(link) => link.getAttribute('href')
113113
);
114114

@@ -141,7 +141,7 @@ test.describe('Playwright Query Link Tests', () => {
141141
(iframe) => iframe.contentWindow.document.querySelector('h1').innerText
142142
);
143143
const href = await page.$eval(
144-
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > div > a.mapml-zoom-link',
144+
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > a.mapml-zoom-link',
145145
(link) => link.getAttribute('href')
146146
);
147147

@@ -176,7 +176,7 @@ test.describe('Playwright Query Link Tests', () => {
176176
(iframe) => iframe.contentWindow.document.querySelector('h1').innerText
177177
);
178178
const href = await page.$eval(
179-
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > div > a.mapml-zoom-link',
179+
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > a.mapml-zoom-link',
180180
(link) => link.getAttribute('href')
181181
);
182182

@@ -254,7 +254,7 @@ test.describe('Playwright Query Link Tests', () => {
254254
(iframe) => iframe.contentWindow.document.querySelector('h1').innerText
255255
);
256256
const link = await page.$eval(
257-
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div > div',
257+
'div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-popup-pane > div > div.leaflet-popup-content-wrapper > div',
258258
(popup) => popup.querySelector('a.mapml-zoom-link')
259259
);
260260

0 commit comments

Comments
 (0)