From 868dd1a036003ebbb53f07b81d3be2fee0611e95 Mon Sep 17 00:00:00 2001 From: Simone Date: Sat, 25 Jul 2026 20:56:33 +0200 Subject: [PATCH] feat(web): click Executions' Started time to toggle relative/absolute Both renderings are pre-rendered server-side into a {% else %} — {% endif %} @@ -137,7 +139,9 @@ — {% if parsed.started %} - {{ parsed.started | relative_time }} + {% else %} — {% endif %} diff --git a/tests/python/test_web_executions.py b/tests/python/test_web_executions.py index f0934ec..3bd1a69 100644 --- a/tests/python/test_web_executions.py +++ b/tests/python/test_web_executions.py @@ -340,6 +340,34 @@ def test_status_badge_has_no_icon_for_non_terminal_states( assert "#i-x" not in resp.text +def test_started_cell_is_a_click_to_toggle_button( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + """Both the relative and absolute renderings are pre-rendered into the + button's data attributes -- app.js swaps textContent/title on click, no + round trip. Server-side, this test can only pin the markup the toggle + depends on, not the click itself.""" + _stub_view( + monkeypatch, + ExecutionsView( + runs=[_execution(started="2026-07-25T11:50:00Z")], + unmatched_vms=[], + source="admin", + error=None, + ), + ) + app = create_app(_make_config(tmp_path)) + app.dependency_overrides[get_backend] = lambda: _FakeBackend([]) + client = TestClient(app) + + resp = client.get("/executions") + + assert '