(t *testing.T)
| 261 | } |
| 262 | |
| 263 | func TestHandler_SuccessfulConnect(t *testing.T) { |
| 264 | hub := NewHub() |
| 265 | defer hub.Close() |
| 266 | store := &mockStore{ |
| 267 | user: newTestUser(), |
| 268 | agent: newTestAgent("user_1"), |
| 269 | } |
| 270 | handler := NewHandler(hub, store) |
| 271 | srv := startServer(t, handler) |
| 272 | |
| 273 | conn, _ := dialWS(t, srv, "bot@agents.e2a.dev", "valid_key") |
| 274 | if conn == nil { |
| 275 | t.Fatal("expected successful WS connection") |
| 276 | } |
| 277 | defer conn.Close(websocket.StatusNormalClosure, "") |
| 278 | |
| 279 | waitConnected(t, hub, "agent_test") |
| 280 | } |
| 281 | |
| 282 | func TestHandler_DrainUnreadOnConnect(t *testing.T) { |
| 283 | hub := NewHub() |
nothing calls this directly
no test coverage detected