from fastapi.testclient import TestClient def test_health_returns_ok(client: TestClient) -> None: response = client.get("/api/health") assert response.status_code == 200 assert response.json()["status"] == "ok" def test_public_config_exposes_no_secret(client: TestClient) -> None: response = client.get("/api/config") assert response.status_code == 200 body = response.json() assert body["appName"] assert body["maxNodes"] > 0 assert "management" not in response.text.lower() def test_security_headers_present(client: TestClient) -> None: response = client.get("/api/health") assert response.headers["X-Content-Type-Options"] == "nosniff" assert "default-src" in response.headers["Content-Security-Policy"] def test_unknown_api_route_returns_clean_404(client: TestClient) -> None: response = client.get("/api/does-not-exist") assert response.status_code == 404 assert response.json()["detail"]