feat: Add realtime Gitea event stream widget #43
|
|
@ -258,7 +258,7 @@ textarea { resize: vertical; min-height: 120px; }
|
||||||
paintEventStream(await res.json());
|
paintEventStream(await res.json());
|
||||||
setEventStreamStatus('Updated ' + fmt(new Date()));
|
setEventStreamStatus('Updated ' + fmt(new Date()));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
qs('#gitea-events').innerHTML = '<div class="muted">Event stream unavailable.</div>';
|
setEventStreamStatus('Update failed · showing last activity');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,13 @@ def test_event_stream_reports_when_activity_was_refreshed():
|
||||||
assert "setEventStreamStatus('Updated ' + fmt(new Date()))" in html
|
assert "setEventStreamStatus('Updated ' + fmt(new Date()))" in html
|
||||||
|
|
||||||
|
|
||||||
|
def test_event_stream_reports_refresh_failure_without_erasing_visible_events():
|
||||||
|
html = DASHBOARD.read_text()
|
||||||
|
|
||||||
|
assert "setEventStreamStatus('Update failed · showing last activity')" in html
|
||||||
|
assert "qs('#gitea-events').innerHTML = '<div class=\"muted\">Event stream unavailable.</div>'" not in html
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
async def test_event_stream_returns_recent_authenticated_gitea_activity(monkeypatch):
|
async def test_event_stream_returns_recent_authenticated_gitea_activity(monkeypatch):
|
||||||
expected = [{"type": "create", "actor": {"login": "timmy"}}]
|
expected = [{"type": "create", "actor": {"login": "timmy"}}]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user