File size: 1,844 Bytes
e37311e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]


def read(path: str) -> str:
    return (ROOT / path).read_text(encoding="utf-8")


def test_build_can_launch_without_manual_space_name_after_prescan():
    js = read("web/static/app.js")
    assert "if(!formValue('targetSpace'))" not in js
    assert "target_space_name:formValue('targetSpace')||undefined" in js
    html = read("web/index.html")
    assert "Target Space name" in html
    assert "optional-label" in html


def test_run_details_are_cached_for_fast_panel_reload():
    js = read("web/static/runs.js")
    assert "function cachedRunDetail" in js
    assert "function rememberRunDetail" in js
    assert "cachedHeavy||cachedLight" in js
    assert "state.runDetailCache" in js


def test_event_feed_uses_vector_icons_not_emoji_or_text_badges():
    js = read("web/static/progress.js")
    css = read("web/static/app.css")
    assert "function renderEventIcon" in js
    assert "EVENT_ICON_PATHS" in js
    assert "data-event-icon" in js
    assert '<svg viewBox="0 0 24 24"' in js
    assert "return'PI'" not in js
    assert "return'GPU'" not in js
    assert "return'API'" not in js
    assert "return'🤖'" not in js
    assert "return'⚡'" not in js
    assert ".activity-row .activity-icon svg" in css


def test_endpoint_picker_explains_set_api_name_and_shows_io():
    js = read("web/static/app.js")
    assert "API name used for validation" in js
    assert "Set API name" in js
    assert "endpointInputItemsFromEntry" in js
    assert "endpointOutputItemsFromEntry" in js
    assert "endpoint-info-card" in js


def test_billing_panel_is_simplified():
    html = read("web/index.html")
    assert "billing-simple" in html
    assert "Open billing dashboard" in html
    assert "Jobs pricing" not in html
    assert "Inference pricing" not in html