| from pathlib import Path | |
| def test_implementation_mode_copy_is_shared_across_ui_sections(): | |
| html = Path("web/index.html").read_text(encoding="utf-8") | |
| components_js = Path("web/static/components.js").read_text(encoding="utf-8") | |
| runs_js = Path("web/static/runs.js").read_text(encoding="utf-8") | |
| app_js = Path("web/static/app.js").read_text(encoding="utf-8") | |
| assert html.count('id="detailImplementationMode"') == 1 | |
| assert '<span>Build goal</span><strong id="detailImplementationMode">—</strong>' in html | |
| assert "function implementationModeLabel" in components_js | |
| assert "function implementationModeDescription" in components_js | |
| assert "implementationModeLabel(mode,{short:true})" in runs_js | |
| assert "setText('detailImplementationMode',mode?implementationModeLabel(mode):'—')" in runs_js | |
| assert "setText('detailImplementationMode',mode?implementationModeLabel(mode):'—')" in app_js | |
| def test_internal_implementation_mode_ids_are_not_rendered_as_labels(): | |
| runs_js = Path("web/static/runs.js").read_text(encoding="utf-8") | |
| assert "Goal" in runs_js | |
| assert "badgeLabel(mode" not in runs_js | |