Files
geointel/backend/tests/test_sprint104_ai_lab_action_guardrails.py
T
Codex 78a5f0b0b2
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s
Close full operational audit findings
2026-07-17 14:19:02 +02:00

41 lines
1.5 KiB
Python

from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def test_detection_lab_distinguishes_configured_model_from_ui_runnable_action() -> None:
lab = (ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx").read_text(
encoding="utf-8"
)
assert "detectionModelUiRunnable" in lab
assert "selectedDetectionModelId !== 'manual-fixture-detector'" in lab
assert "detectionRunBlockedReason" in lab
assert "Het fixturemodel is alleen bedoeld voor expliciete tests" in lab
assert "Klaar om gebouwen te zoeken" in lab
assert "disabled={runningDetection || !detectionRunReady}" in lab
def test_segmentation_lab_distinguishes_configured_model_from_ui_runnable_action() -> None:
lab = (ROOT / "frontend" / "src" / "components" / "segmentation" / "SegmentationLab.tsx").read_text(
encoding="utf-8"
)
assert "segmentationModelUiRunnable" in lab
assert "selectedSegmentationModelId !== 'fixture-segmenter'" in lab
assert "segmentationRunBlockedReason" in lab
assert "Het fixturemodel is alleen bedoeld voor expliciete tests" in lab
assert "Analyse" in lab
assert "disabled={runningSegmentation || !segmentationRunReady}" in lab
def test_ai_lab_guardrail_styles_remain_compact() -> None:
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
assert ".lab-action-guardrail" in css
assert ".lab-action-guardrail-ready" in css
assert "overflow-wrap: anywhere;" in css