Testing
Chat UI tests use Vitest + Testing Library across protocol, session, and UI layers.
Commands
npm run test
npm run test:watch
npm run check
Current Test Files
src/lib/protocol/types.test.tssrc/lib/protocol/e2e.test.tssrc/lib/protocol/client.test.tssrc/lib/session/auth-storage.test.tssrc/lib/session/connection-controller.test.tssrc/lib/stores/session.test.tssrc/lib/components/PairingScreen.test.tssrc/lib/components/StatusBar.test.tssrc/lib/theme.test.tssrc/lib/ui/preferences.test.ts
What These Tests Protect
- protocol envelope construction/validation
- E2E key + encryption/decryption correctness
- client connect/pair/send/reconnect lifecycle
- session timeline updates for stream/tool/approval/error events
- auth storage TTL cleanup behavior
- pairing/status/theme UI interactions
Pre-Merge Minimum
npm run testnpm run check- manual smoke: pair, send message, see streamed output, logout, reconnect