from fastapi.testclient import TestClient

from app.main import app


def test_children_seeded(tmp_path, monkeypatch):
    monkeypatch.setenv("FAMILYDASHBOARD_DATABASE_URL", f"sqlite:///{tmp_path / 'test.db'}")
    with TestClient(app) as client:
        response = client.get("/api/children")
    assert response.status_code == 200
    names = [child["name"] for child in response.json()]
    assert names == ["Emilia", "Valerie"]
