Context
MessagesApp.tsx is a 2,385-line monolithic component handling channels, messages, WebSocket, threads, pins, attachments, reactions, slash commands, typing indicators, and canvas viewing. It has zero direct test files.
Suggested Approach
- Extract sub-components:
MessageList, MessageInput, ChannelSidebar, ThreadPanel, ReactionBar
- Write tests for each using Vitest + Testing Library
- Integration test the WebSocket reconnection logic (mock WebSocket)
- Test the custom markdown renderer for edge cases
- The existing 15 test files in
chat/__tests__/ are a good foundation
Context
MessagesApp.tsxis a 2,385-line monolithic component handling channels, messages, WebSocket, threads, pins, attachments, reactions, slash commands, typing indicators, and canvas viewing. It has zero direct test files.Suggested Approach
MessageList,MessageInput,ChannelSidebar,ThreadPanel,ReactionBarchat/__tests__/are a good foundation