feat(growth): add WHO percentile growth curves, Chart.js collapsible section, and tests
This commit is contained in:
@@ -782,6 +782,35 @@ def test_growth_logging(temp_datastore: DatastoreEngine):
|
||||
assert summary["growth_latest"]["height_cm"] == 67.5
|
||||
|
||||
|
||||
def test_website_growth_html_rendering(temp_datastore: DatastoreEngine):
|
||||
"""Verifies that update_website generates valid HTML containing the growth section and Chart.js code."""
|
||||
from update_website import generate_dashboard_html
|
||||
|
||||
temp_datastore.put_entity(
|
||||
collection="people",
|
||||
record={"id": "mila", "name": "Mila Graf", "birthdate": "2026-03-14", "role": "child"},
|
||||
)
|
||||
temp_datastore.add_event(
|
||||
kind="growth.measurement",
|
||||
subject="mila",
|
||||
actor="agent:hebamme",
|
||||
start="2026-10-12T10:00:00+02:00",
|
||||
payload={"weight_kg": 7.45, "height_cm": 68.0},
|
||||
note="U5 Untersuchung",
|
||||
)
|
||||
|
||||
html = generate_dashboard_html(temp_datastore)
|
||||
assert "Körpergröße & Gewicht (WHO-Perzentilen)" in html
|
||||
assert "7.45 kg" in html
|
||||
assert "68.0 cm" in html
|
||||
assert "U5 Untersuchung" in html
|
||||
assert "chart.umd.min.js" in html
|
||||
assert "growthChart" in html
|
||||
assert "who_weight" in html
|
||||
assert "who_height" in html
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user