from pathlib import Path from tests.frontend_contract import read_feature ROOT = Path(__file__).resolve().parents[2] def test_detection_lab_exposes_persisted_threshold_calibration_comparison() -> None: detection_lab = ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx" todo = ROOT / "docs" / "TODO.md" source = detection_lab.read_text(encoding="utf-8") app_source = read_feature("shell") todo_source = todo.read_text(encoding="utf-8") assert "qualityChecks: QualityCheckRead[]" in source assert "buildCalibrationRows(detectionRuns, qualityChecks)" in source assert "Kalibraties vergelijken" in source assert "Vergelijk bewaarde analyseruns per zekerheidsdrempel" in source assert "Beste F1-score" in source assert "Beste precisie" in source assert "Minste foutieve meldingen" in source assert "Drempel" in source assert "Precisie" in source assert "Herkenningsgraad" in source assert "F1" in source assert "Fout positief" in source assert "Fout negatief" in source assert "Keur pas goed nadat meerdere gebieden" in source assert "Nog geen kalibratievergelijking beschikbaar" in source assert "metricValue(check, 'f1')" in source assert "metricValue(check, 'precision')" in source assert "metricValue(check, 'recall')" in source assert "metricValue(check, 'false_positives')" in source assert "confidenceThresholdForRun(run)" in source assert "qualityChecks={qualityChecks}" in app_source assert "[x] Add full threshold calibration comparison UX" in todo_source