fix: make run rows clickable and limit dashboard runs

This commit is contained in:
Anton
2026-05-07 16:23:39 +03:00
parent c97ced52b4
commit 52c5cc1af1
6 changed files with 24 additions and 6 deletions

View File

@@ -35,6 +35,13 @@ def test_admin_employees_route_redirects_to_directory():
assert 'RedirectResponse("/admin/directory", status_code=303)' in source
def test_dashboard_limits_latest_runs_to_five():
source = Path("app/admin.py").read_text(encoding="utf-8")
assert "order_by(desc(CrawlRun.started_at)).limit(5)" in source
assert "order_by(desc(CrawlRun.started_at)).limit(10)" not in source
def test_runs_template_links_to_run_detail():
template = Path("app/templates/runs.html").read_text(encoding="utf-8")
@@ -61,3 +68,10 @@ def test_dashboard_metric_cards_link_to_admin_targets():
assert '/admin/runs/{{ latest_run.id }}#new-employees' in template
assert 'href="/admin/directory?status=dismissed"' in template
assert 'href="/admin/runs"' in template
def test_dashboard_latest_run_rows_link_to_run_detail():
template = Path("app/templates/dashboard.html").read_text(encoding="utf-8")
assert 'data-row-href="/admin/runs/{{ run.id }}"' in template
assert 'href="/admin/runs/{{ run.id }}"' in template

View File

@@ -23,7 +23,7 @@ def test_health_returns_versions():
response = client.get("/api/health")
assert response.status_code == 200
assert response.json()["backend_version"] == "0.4.1"
assert response.json()["backend_version"] == "0.4.2"
def test_mcp_requires_token_and_lists_tools():