fix: make run rows clickable and limit dashboard runs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user