| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_recovery_panel_requires_real_recovery_signal(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| assert "function nonEmptyObject" in runs | |
| assert "nonEmptyObject(decision)" in runs | |
| assert "nonEmptyObject(blockage)" in runs | |
| assert "detail.repair_decision||detail.blockage" not in runs | |
| def test_normal_pi_steps_do_not_trigger_recovery_panel(): | |
| runs = (ROOT / "web" / "static" / "runs.js").read_text(encoding="utf-8") | |
| recovery_block = runs.split("const recoveryStepPattern=", 1)[1].split("return Boolean", 1)[0] | |
| assert "pi_run" not in recovery_block | |
| assert "pi_config" not in recovery_block | |
| assert "pi_install" not in recovery_block | |
| assert "pi_diagnosis" in recovery_block | |