Files
hermes-web-ui/tests
ekko a948eee4b9 test: fix failing tests for mocks and API return types (#366)
* fix(chat): isolate concurrent session events by refactoring WebSocket event handling

Refactored the WebSocket event handling mechanism to use global listeners with session-specific event routing instead of per-session listeners. This prevents event cross-talk when multiple chat sessions run concurrently.

Key changes:
- Client: Added sessionEventHandlers Map to route events to appropriate sessions
- Client: Registered global listeners once per socket connection
- Server: Extracted message processing logic into handleMessage method
- Server: Improved Hermes session ID tracking with dedicated Map
- Server: Added replaceByHermesSessionId for targeted message replacement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: fix failing tests for mocks and API return types

- Fixed sessions-routes.test.ts: added missing setWorkspace and listWorkspaceFolders mocks
- Fixed usage-store.test.ts: removed test for non-existent initUsageStore function
- Fixed profiles-store.test.ts: corrected createProfile API return type to { success: true }
- Fixed syntax error in usageStatsMock (ctx.body: → ctx.body =)

All tests now pass (314 passed | 2 skipped).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:24:57 +08:00
..