Polish live runs status layout

This commit is contained in:
Abel Luck 2026-03-31 12:35:41 +02:00
parent ba33491479
commit 73617cd40c
6 changed files with 203 additions and 48 deletions

View file

@ -217,9 +217,58 @@ def test_runs_page_renders_combined_running_jobs_table() -> None:
assert "Running jobs" in body
assert "queued-source" in body
assert ">Queued<" in body
assert "bg-amber-200 text-amber-950" in body
assert "/actions/queued-executions/42/cancel" in body
def test_runs_page_renders_running_state_cell_with_duration_and_started_at() -> None:
started_at = "2026-03-30T12:00:00+00:00"
body = str(
runs_page(
running_executions=(
{
"source": "Running source",
"slug": "running-source",
"job_id": 1,
"execution_id": 11,
"started_at": "2 minutes ago",
"started_at_iso": started_at,
"duration": "00:00:10",
"runtime": "running for 10s",
"status": "Running",
"stats": "1 requests • 1 items • 1 byte",
"worker": "streaming stats from worker",
"log_href": "/job/1/execution/11/logs",
"cancel_label": "Stop",
"cancel_post_path": "/actions/executions/11/cancel",
},
)
)
)
assert re.search(
r"<th[^>]*>State</th>\s*<th[^>]*>Source</th>\s*<th[^>]*>Details</th>",
body,
)
assert not re.search(
r"<th[^>]*>#</th>\s*<th[^>]*>Source</th>\s*<th[^>]*>Activity</th>\s*<th[^>]*>State</th>",
body,
)
assert ">#11<" in body
assert ">00:00:10<" in body
assert ">2 minutes ago<" in body
assert 'data-started-at="2026-03-30T12:00:00+00:00"' in body
assert 'title="2026-03-30T12:00:00+00:00"' in body
assert "bg-sky-100 text-sky-800" in body
assert 'viewBox="0 0 640 640"' in body
assert "rotate-180" in body
assert "M512 320C512 214 426 128 320 128L320 512" in body
assert "M12 6v6h4.5" in body
assert "M6.75 3v2.25M17.25 3v2.25" in body
assert "Running" in body
assert "time[data-next-run-at], time[data-ended-at], time[data-started-at]" in body
def test_runs_page_moves_scheduled_jobs_state_column_to_second_position() -> None:
body = str(
runs_page(