Fixes race condition where WebSocket disconnect event wasn't being processed within React's rendering cycle, causing intermittent CI failures. Wrapping mockOnClose() in act() ensures React state updates are flushed before assertions run. Resolves #237