forked from Rockachopa/Timmy-time-dashboard
- Add 8 tests for timmy_serve/cli.py (start, invoice, status commands) covering default args, custom args, and output validation - Add 8 tests for voice_enhanced route covering all intent types (status, help, swarm, voice, chat fallback) plus error handling - Add 17 tests for websocket/handler.py covering broadcast to multiple clients, dead connection cleanup, history trimming, connect/disconnect, and all convenience broadcast methods - Add 4 tests for the new GET /swarm/live page route Total new tests: 37
24 lines
841 B
Python
24 lines
841 B
Python
"""Tests for the GET /swarm/live page route."""
|
|
|
|
|
|
class TestSwarmLivePage:
|
|
def test_swarm_live_returns_html(self, client):
|
|
resp = client.get("/swarm/live")
|
|
assert resp.status_code == 200
|
|
assert "text/html" in resp.headers["content-type"]
|
|
|
|
def test_swarm_live_contains_dashboard_title(self, client):
|
|
resp = client.get("/swarm/live")
|
|
assert "Live Swarm Dashboard" in resp.text
|
|
|
|
def test_swarm_live_contains_websocket_script(self, client):
|
|
resp = client.get("/swarm/live")
|
|
assert "/swarm/live" in resp.text
|
|
assert "WebSocket" in resp.text
|
|
|
|
def test_swarm_live_contains_stat_elements(self, client):
|
|
resp = client.get("/swarm/live")
|
|
assert "stat-agents" in resp.text
|
|
assert "stat-active" in resp.text
|
|
assert "stat-tasks" in resp.text
|