agentic-space-factory-UI-public / tests /test_v52_ui_fixes.py
fffiloni's picture
Upload 19 files
b618cc8 verified
Raw
History Blame
1.9 kB
from pathlib import Path
def test_bucket_setup_block_is_visible_above_new_build():
html = Path("web/index.html").read_text(encoding="utf-8")
assert 'id="bucketSetupPanel"' in html
assert html.index('id="bucketSetupPanel"') < html.index('id="newBuildCard"')
assert 'id="checkBucket"' in html
assert 'id="createBucket"' in html
def test_user_chip_is_a_real_sign_in_link():
html = Path("web/index.html").read_text(encoding="utf-8")
assert 'id="userChip" href="/oauth/huggingface/login"' in html
js = Path("web/static/app.js").read_text(encoding="utf-8")
assert "userChip.href='/oauth/huggingface/login'" in js
assert "userChip.href=`https://huggingface.co/${me.username}`" in js
def test_view_all_events_has_real_handler_and_events_panel():
html = Path("web/index.html").read_text(encoding="utf-8")
js = Path("web/static/app.js").read_text(encoding="utf-8")
assert 'id="viewAllEvents"' in html
assert 'id="allEventsPanel"' in html
assert 'id="eventsPanel"' in html
assert "viewAllEvents" in js
assert "panel.open=true" in js
def test_runs_explorer_is_limited_to_five_rows_with_pagination():
html = Path("web/index.html").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 'id="runsPagination"' in html
assert "runsPerPage:5" in app_js
assert "renderRunPagination" in runs_js
assert "runs.slice(state.runPage*perPage,state.runPage*perPage+perPage)" in runs_js
def test_progress_endpoint_uses_view_model_links_for_job_url():
app_py = Path("app.py").read_text(encoding="utf-8")
assert '"version": "v52-ui-fidelity-fixes"' in app_py
assert 'view = build_run_view_model(run_id, bundle, bucket_source=bucket_source)' in app_py
assert '"links": view.get("links")' in app_py