| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_active_run_prefill_only_requires_target_space_for_best_effort_prefill(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| assert "function runHasValidationResult" in runs | |
| assert "const canPrefill=Boolean(targetSpace)" in runs | |
| assert "Space Test prefill becomes available as soon as the target Space is known." in runs | |
| def test_delete_run_requires_finished_status(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| assert "function runIsFinished" in runs | |
| assert "const canDelete=Boolean(runId&&runCanBeDeleted(status))" in runs | |
| assert "after the Job is finished or if only stale metadata remains" in runs | |
| def test_run_documents_merge_backend_presence_with_stable_cache(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| assert "const rawTrace=traceDocState('traces/raw',byId.get('pi_raw_trace'))" in runs | |
| assert "const redactedTrace=traceDocState('traces/redacted',byId.get('pi_redacted_trace'))" in runs | |
| assert "nonEmptyObject(detail.repair_decision)" in runs | |
| assert "nonEmptyObject(detail.blockage)" in runs | |
| assert "function mergeStableRunDocuments" in runs | |
| assert "present:Boolean(doc.present||previous.present)" in runs | |
| def test_timeline_current_step_pulse_is_restored(): | |
| css = (ROOT / "web" / "static" / "app.css").read_text(encoding="utf-8") | |
| assert "@keyframes timeline-current-pulse" in css | |
| assert "animation: timeline-current-pulse" in css | |
| def test_run_stats_wording_is_user_friendly(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| assert "Test response time" in runs | |
| assert "Typical " in runs | |
| assert "slowest recent" in runs | |
| assert "Things to review" in runs | |