diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index b941205a..3e7def06 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -108,7 +108,7 @@ export default class Umap { // Do not display in an iframe. if (window.self !== window.top) { - geojson.properties.homeControl = false + this.properties.homeControl = false } this._leafletMap.setup() diff --git a/umap/tests/integration/test_iframe.py b/umap/tests/integration/test_iframe.py new file mode 100644 index 00000000..8c1f770c --- /dev/null +++ b/umap/tests/integration/test_iframe.py @@ -0,0 +1,25 @@ +from playwright.sync_api import expect + + +def test_home_control_is_hidden(live_server, map, tilelayer, page): + body = f""" + + + + + + + """ + + def handle(route): + route.fulfill(body=body) + + url = f"{live_server.url}/test-iframe" + # Intercept the route + page.route(url, handle) + + page.goto(url) + expect( + page.locator("iframe").content_frame.get_by_role("link", name="Home logo") + ).to_be_hidden()