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