Add HTML5 operations SSE updates
This commit is contained in:
@@ -619,11 +619,22 @@ def test_html5_operations_renders_job_monitor_fragments():
|
||||
assert 'data-html5-page="operations"' in page.text
|
||||
assert "data-html5-operations-body" in page.text
|
||||
assert "data-html5-operations-summary" in page.text
|
||||
assert 'hx-get="/html5/operations/jobs"' in page.text
|
||||
assert 'hx-get="/html5/operations/summary"' in page.text
|
||||
assert 'hx-ext="sse"' in page.text
|
||||
assert 'sse-connect="/html5/operations/events"' in page.text
|
||||
assert 'sse-swap="operations-summary"' in page.text
|
||||
assert 'sse-swap="operations-jobs"' in page.text
|
||||
assert 'hx-trigger="every 3s"' not in page.text
|
||||
assert project_id in page.text
|
||||
assert "__next" not in page.text
|
||||
|
||||
with client.stream("GET", "/html5/operations/events?once=1") as events:
|
||||
first_chunk = next(events.iter_text())
|
||||
assert "event: operations-summary" in first_chunk
|
||||
assert "event: operations-jobs" in first_chunk
|
||||
assert "data-html5-operations-summary" in first_chunk
|
||||
assert "data-html5-operation" in first_chunk
|
||||
assert project_id in first_chunk
|
||||
|
||||
rows = client.get("/html5/operations/jobs")
|
||||
assert rows.status_code == 200
|
||||
assert "text/html" in rows.headers["content-type"]
|
||||
|
||||
Reference in New Issue
Block a user