Refine publisher dashboard layout
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.

This commit is contained in:
Abel Luck 2026-06-02 11:11:36 +02:00
parent 2147d9c999
commit 813f19f355
8 changed files with 350 additions and 53 deletions

View file

@ -414,6 +414,28 @@ def test_root_get_redirects_to_publisher() -> None:
asyncio.run(run())
@pytest.mark.parametrize(
("source_path", "target_path"),
(
("/admin/", "/admin"),
("/publisher/", "/publisher"),
("/admin/publisher/", "/admin/publisher"),
),
)
def test_dashboard_trailing_slashes_redirect_to_canonical_paths(
source_path: str, target_path: str
) -> None:
async def run() -> None:
client = create_app().test_client()
response = await client.get(source_path)
assert response.status_code == 302
assert response.headers["Location"] == target_path
asyncio.run(run())
def test_admin_get_serves_datastar_shim_with_admin_static_assets() -> None:
async def run() -> None:
client = create_app().test_client()
@ -1153,6 +1175,12 @@ def test_render_publisher_shows_published_feeds_with_publisher_actions(
assert 'href="/feeds/publisher-source/feed.rss"' not in body
assert "Available" in body
assert "Next run" in body
assert "md:w-[32%]" in body
assert "table-fixed" in body
assert "min-w-0" in body
assert "md:hidden" in body
assert ">Updated<" in body
assert ">Next<" in body
assert "Disk usage" not in body
assert f"/publisher/actions/jobs/{job.id}/run-now" in body
assert f"/admin/actions/jobs/{job.id}/run-now" not in body
@ -1222,6 +1250,14 @@ def test_render_publisher_shows_live_work_without_admin_controls(
assert "Publisher running source" in body
assert "Publisher queued source" in body
assert "Queue position #1" in body
assert "w-[34%]" in body
assert "w-[66%]" in body
assert "hidden" in body
assert "md:table-cell" in body
assert "md:min-w-[10rem]" in body
assert ">Stats<" in body
assert ">Worker<" in body
assert ">Queued<" in body
assert f"/publisher/job/{running_job.id}/execution/" not in body
assert (
f"/publisher/actions/executions/{int(running_execution.get_id())}/cancel"