from httpx import AsyncClient async def test_health_endpoint(client: AsyncClient) -> None: response = await client.get("/health") assert response.status_code == 200 data = response.json() assert data["status"] == "ok" async def test_app_has_title(client: AsyncClient) -> None: response = await client.get("/openapi.json") assert response.status_code == 200 data = response.json() assert data["info"]["title"] == "Porchlight" async def test_app_has_repos_on_state(client: AsyncClient) -> None: from porchlight.store.protocols import ( CredentialRepository, MagicLinkRepository, UserRepository, ) app = client._transport.app # type: ignore[union-attr] assert isinstance(app.state.user_repo, UserRepository) assert isinstance(app.state.credential_repo, CredentialRepository) assert isinstance(app.state.magic_link_repo, MagicLinkRepository) async def test_landing_page(client: AsyncClient) -> None: response = await client.get("/") assert response.status_code == 200 assert "text/html" in response.headers["content-type"] body = response.text assert "