Remplacer la fiche de dalle flottante par une bulle et une fiche détaillée dans le panneau
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -246,6 +246,28 @@ def test_map_tile_info(tmp_path, monkeypatch):
|
||||
assert mapserve.map_tile_info(lat=45.0, lng=1.0)["found"] is False
|
||||
|
||||
|
||||
def test_map_tile_includes_quality(tmp_path, monkeypatch):
|
||||
"""/api/map/tile joint la qualité (densité, dates d'acquisition) si connue."""
|
||||
mapserve = _setup(tmp_path, monkeypatch, layers=("relief_oriente",))
|
||||
from lidar_pipeline.quality import write_quality, QUALITY_VERSION
|
||||
name = "LHD_FXX_1054_6882_PTS_LAMB93_IGN69"
|
||||
write_quality(tmp_path, name, {"version": QUALITY_VERSION, "ground_density": 12.5,
|
||||
"density_grid": [[12.5]], "empty_fraction": 0.1,
|
||||
"acq_start": "2021-03-02", "acq_end": "2021-03-02",
|
||||
"acq_source": "gps"})
|
||||
lat, lon = _center()
|
||||
d = mapserve.map_tile_info(lat=lat, lng=lon)
|
||||
assert d["quality"] == {"ground_density": 12.5, "acq_start": "2021-03-02",
|
||||
"acq_end": "2021-03-02"}
|
||||
|
||||
|
||||
def test_map_tile_quality_absent_is_none(tmp_path, monkeypatch):
|
||||
"""Sans sidecar qualité, la clé vaut None (pas d'erreur)."""
|
||||
mapserve = _setup(tmp_path, monkeypatch, layers=("relief_oriente",))
|
||||
lat, lon = _center()
|
||||
assert mapserve.map_tile_info(lat=lat, lng=lon)["quality"] is None
|
||||
|
||||
|
||||
def test_healthz_and_assets(tmp_path, monkeypatch):
|
||||
"""Sonde de santé et assets de l'interface (revalidés, jamais immuables)."""
|
||||
from fastapi import HTTPException
|
||||
@ -302,6 +324,20 @@ def test_map_ui_tile_load_indicator_and_selection_pane():
|
||||
assert "pane: 'tileSel'" in _MAP_JS
|
||||
|
||||
|
||||
def test_ui_tile_popup_and_details_view():
|
||||
"""La fiche de dalle est une bulle Leaflet + une vue détaillée dans le panneau."""
|
||||
from lidar_pipeline.mapui import _MAP_CSS, _MAP_HTML, _MAP_JS
|
||||
assert 'id="tilecard"' not in _MAP_HTML
|
||||
for id_ in ("tileView", "tileBack", "tileTitle", "tileBody"):
|
||||
assert f'id="{id_}"' in _MAP_HTML, id_
|
||||
for fn in ("function showTilePopup(", "function openTileDetails(", "function closeTileViews("):
|
||||
assert fn in _MAP_JS, fn
|
||||
assert "L.popup(" in _MAP_JS and "Détails" in _MAP_JS
|
||||
# Pas de bulle pendant le déplacement du cadre d'export ni un tracé
|
||||
click = _MAP_JS[_MAP_JS.index("map.on('click'"):]
|
||||
assert "genDrawing" in click[:400] and "PRINT.dragging" in click[:400]
|
||||
|
||||
|
||||
def test_defaults_roundtrip(tmp_path, monkeypatch):
|
||||
"""L'affichage réglé depuis la carte devient la configuration servie à tous."""
|
||||
import lidar_pipeline.mapserve as mapserve
|
||||
|
||||
Reference in New Issue
Block a user