| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_new_build_clears_run_scoped_pi_model_warning(): | |
| app = (ROOT / "web" / "static" / "app.js").read_text(encoding="utf-8") | |
| set_active = app.split("function setActiveRun", 1)[1].split("function startPolling", 1)[0] | |
| assert "resetRunDetails()" in set_active | |
| assert "if(state.poll){clearInterval(state.poll);state.poll=null}" in set_active | |
| def test_progress_poll_recomputes_blockers_for_current_run(): | |
| app = (ROOT / "web" / "static" / "app.js").read_text(encoding="utf-8") | |
| refresh = app.split("function refreshProgress", 1)[1].split("function numberFromEvents", 1)[0] | |
| assert "renderBlockers(p)" in refresh | |
| assert "renderAgentRecovery(p)" in refresh | |
| def test_start_polling_clears_stale_blocker_warning_when_switching_runs(): | |
| app = (ROOT / "web" / "static" / "app.js").read_text(encoding="utf-8") | |
| start = app.split("function startPolling", 1)[1].split("async function bootstrapRunRecovery", 1)[0] | |
| assert "const blockers=$('selectedBlockers')" in start | |
| assert "blockers.hidden=true" in start | |
| def test_render_blockers_ignores_stale_run_detail(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| fn = runs.split("function renderBlockers", 1)[1].split("function renderRunDetail", 1)[0] | |
| assert "detailRunId" in fn | |
| assert "detailRunId!==state.runId" in fn | |
| assert "root.hidden=true" in fn | |