File size: 2,075 Bytes
aad6d9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da65740
 
 
 
aad6d9e
 
 
 
 
 
 
 
 
 
 
 
 
da65740
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from pathlib import Path


def test_delete_selected_run_resets_active_run_every_time():
    runs = Path("web/static/runs.js").read_text(encoding="utf-8")
    assert "async function deleteSelectedRun" in runs
    assert "resetRunDetails();" in runs
    assert "state.selectedRunDetail=null" in runs
    assert "state.activeLinks={}" in runs
    assert "document.querySelectorAll('.run-row')" in runs


def test_reset_run_details_clears_active_run_panels():
    app = Path("web/static/app.js").read_text(encoding="utf-8")
    reset = app.split("function resetRunDetails()", 1)[1].split("function prepareNewBuild()", 1)[0]
    for token in [
        "progressTitle",
        "progressStatus",
        "currentStep",
        "lastEvent",
        "progressPercent",
        "activityFeed",
        "artifactList",
        "deleteSelectedRun",
        "renderTimeline(DEFAULT_TIMELINE,'idle')",
    ]:
        assert token in reset


def test_events_are_compact_by_default_and_expand_in_same_list():
    html = Path("web/index.html").read_text(encoding="utf-8")
    js = Path("web/static/progress.js").read_text(encoding="utf-8")
    css = Path("web/static/app.css").read_text(encoding="utf-8")
    assert "allEventsPanel" not in html
    assert "eventsPanel" not in html.split("latest-events-card", 1)[1].split("report-card", 1)[0]
    assert "activityFeedState={lastItems:[]" in js
    assert "const visible=[...list].reverse()" in js
    assert "toggleAllEvents" not in js
    assert "max-height:184px" in css


def test_timeline_has_stopped_state_without_running_animation_confusion():
    js = Path("web/static/progress.js").read_text(encoding="utf-8")
    css = Path("web/static/app.css").read_text(encoding="utf-8")
    assert "status-stopped" in js
    assert "status-muted" in js
    assert "PROGRESS_TERMINAL_STATUSES.has(overall)" in js
    assert ".step.status-stopped .step-dot" in css
    assert "animation:none!important" in css


def test_app_version_v64():
    assert '"version": "v70-progress-resume-events-latency"' in Path("app.py").read_text(encoding="utf-8")