Fix dashboard text overflow and close v1 docs gaps
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from time import perf_counter
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
@@ -299,6 +300,26 @@ def test_dashboard_overview_uses_cache_without_ha_roundtrip(tmp_path: Path) -> N
|
||||
assert payload["discovery_groups"]
|
||||
|
||||
|
||||
def test_dashboard_start_path_stays_within_five_second_budget(tmp_path: Path) -> None:
|
||||
with TestClient(app) as client:
|
||||
_install_service(tmp_path)
|
||||
client.get("/v1/actuators/discovery")
|
||||
client.post("/v1/actuators", json={"actuator_entity_id": "light.abstellkammer"})
|
||||
|
||||
root_started_at = perf_counter()
|
||||
root_response = client.get("/")
|
||||
root_elapsed = perf_counter() - root_started_at
|
||||
|
||||
dashboard_started_at = perf_counter()
|
||||
dashboard_response = client.get("/v1/actuators/dashboard")
|
||||
dashboard_elapsed = perf_counter() - dashboard_started_at
|
||||
|
||||
assert root_response.status_code == 200
|
||||
assert dashboard_response.status_code == 200
|
||||
assert root_elapsed < 5.0
|
||||
assert dashboard_elapsed < 5.0
|
||||
|
||||
|
||||
def test_discovery_reads_entities_once_and_reuses_them(tmp_path: Path) -> None:
|
||||
with TestClient(app) as client:
|
||||
_install_service(tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user