Fix webchat test for WSS single-dispatcher refactor

Wire connection handler manually in test since start() no longer
registers on WSS directly.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
alsk1992
2026-02-11 19:08:13 +00:00
co-authored by Claude Haiku 4.5
parent 7edb42d30b
commit 7a7806979c
+6
View File
@@ -69,6 +69,12 @@ test('webchat auth and message flow', async () => {
);
channel.start(wss);
// After the WSS single-dispatcher refactor, start() no longer registers
// a listener on wss directly — the gateway server dispatches via a mutable
// callback. In tests we wire it up manually.
const handler = channel.getConnectionHandler();
if (handler) wss.on('connection', handler);
const ws = new WebSocket(`ws://127.0.0.1:${port}/chat`);
const queue = createMessageQueue(ws);