osint-dashboard/tests/test_camera_popup_contract.py

16 lines
469 B
Python
Raw Permalink Normal View History

"""Camera list is slim (no URLs). Popup must fetch GET /api/cameras/{id}."""
from pathlib import Path
HTML = Path(__file__).resolve().parents[1] / "app/static/index.html"
def test_popupopen_fetches_camera_detail_row():
html = HTML.read_text()
start = html.index("map.on('popupopen'")
end = html.index("map.on('popupclose'")
block = html[start:end]
assert "fetch(" in block
assert "/api/cameras/" in block
assert "camPopupHtml(" in block