Files
geointel/backend/tests/test_frontend_api_client_error_parser.py
Jens faeb58ef6d
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
Initial public release
2026-08-31 21:56:53 +02:00

23 lines
730 B
Python

from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def test_frontend_api_client_accepts_top_level_error_contract() -> None:
client = (ROOT / "frontend" / "src" / "services" / "api" / "client.ts").read_text(encoding="utf-8")
assert 'typeof payload?.error === "string"' in client
assert "payload?.message" in client
assert "payload?.details" in client
def test_frontend_api_client_remains_legacy_error_tolerant() -> None:
client = (ROOT / "frontend" / "src" / "services" / "api" / "client.ts").read_text(encoding="utf-8")
assert "legacyError?.code" in client
assert "legacyError?.message" in client
assert "legacyError?.details" in client