fix: hydrate camera popup from GET /api/cameras/{id}
List payload is slim (no URLs). YouTube thumbs need source_url from the detail endpoint, so the popup fetches the full row before rendering.
This commit is contained in:
parent
1b1f2d3b3a
commit
700f56ef51
2 changed files with 51 additions and 14 deletions
15
tests/test_camera_popup_contract.py
Normal file
15
tests/test_camera_popup_contract.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""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
|
||||
Loading…
Reference in a new issue