from pathlib import Path def test_bucket_document_links_use_tree_urls_not_blob_urls(): bucket_py = Path("src/bucket.py").read_text(encoding="utf-8") runs_js = Path("web/static/runs.js").read_text(encoding="utf-8") assert "/blob/runs/" not in bucket_py assert "/blob/runs/" not in runs_js assert "def _bucket_file_url" in bucket_py assert "tree/{_runs_prefix()}" in bucket_py or "tree/{prefix}" in bucket_py assert "bucketRunFileUrl" in runs_js def test_billing_panel_does_not_claim_numeric_quotas_are_available(): html = Path("web/index.html").read_text(encoding="utf-8") js = Path("web/static/app.js").read_text(encoding="utf-8") assert "id=\"billingUsage\"" in html assert "Dashboard only" in html assert "Open HF Billing" in js assert "Live quotas, spend and compute usage remain in the HF Billing dashboard" in js assert "billingCredits" not in html assert "billingCredits" not in js def test_run_stats_panel_is_aggregate_and_labeled(): js = Path("web/static/runs.js").read_text(encoding="utf-8") css = Path("web/static/app.css").read_text(encoding="utf-8") assert "runStatsCell" in js assert "runStatsIssueCounts" in js assert ".run-stat-cell span" in css assert "health-label" not in js def test_run_explorer_cards_are_narrow_safe(): css = Path("web/static/app.css").read_text(encoding="utf-8") assert ".run-row.run-card{grid-template-columns:minmax(0,1fr)" in css assert ".run-card-side{width:100%;justify-self:stretch" in css assert ".run-card-meta span{min-width:0" in css def test_validation_timeline_is_point_based_not_column_cards(): css = Path("web/static/app.css").read_text(encoding="utf-8") assert ".validation-timeline{display:flex" in css assert ".validation-step:not(:last-child)::after" in css assert "background:transparent!important" in css