File size: 1,144 Bytes
4cf7d37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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