refactor(radiosonde): use MapUtils.init + Settings tile layer on sonde map

Replace hardcoded L.map() + CartoCD dark tile layer with MapUtils.init()
and add tactical overlays. Adds test verifying the cartocdn URL is gone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-04-13 23:27:36 +01:00
parent ac2f7ea032
commit 3693b02cb9
2 changed files with 29 additions and 8 deletions

View File

@@ -62,3 +62,16 @@ def test_index_includes_map_utils(client):
html = resp.data.decode()
assert "map-utils.js" in html
assert "MapUtils.init" in html
def test_radiosonde_mode_uses_map_utils(client):
"""Main SPA index (which includes radiosonde partial) uses MapUtils for radiosonde map."""
with client.session_transaction() as sess:
sess["logged_in"] = True
resp = client.get("/")
assert resp.status_code == 200
html = resp.data.decode()
# Radiosonde map init in partial should call MapUtils.init, not bare L.tileLayer
assert "radiosondeMap" in html
# The bare cartocdn URL that was previously hardcoded should be gone
assert "basemaps.cartocdn.com/dark_all" not in html or html.count("basemaps.cartocdn.com/dark_all") == 0