MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestHandler_SuccessfulConnect

Function TestHandler_SuccessfulConnect

internal/ws/handler_test.go:263–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

261}
262
263func 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
282func TestHandler_DrainUnreadOnConnect(t *testing.T) {
283 hub := NewHub()

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
NewHubFunction · 0.85
newTestUserFunction · 0.85
newTestAgentFunction · 0.85
NewHandlerFunction · 0.85
startServerFunction · 0.85
dialWSFunction · 0.85
waitConnectedFunction · 0.85

Tested by

no test coverage detected