You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Deduplicate test infrastructure and copy-to-clipboard logic (#441)
After the SSH runtime commit (#178, commit 5f200a6), there was
significant duplication in test infrastructure and repeated
copy-to-clipboard patterns across components.
## Test Infrastructure Consolidation
Consolidated 3 overlapping test helper modules and inline duplicates
into `tests/ipcMain/helpers.ts`:
- Added `extractTextFromEvents()`, `sendMessageAndWait()`,
`createWorkspaceWithInit()`
- Centralized test constants (INIT_HOOK_WAIT_MS, SSH_INIT_WAIT_MS,
HAIKU_MODEL, timeouts)
- Updated 4 test files to use consolidated helpers
- Deleted `tests/ipcMain/test-helpers/runtimeTestHelpers.ts` (149 lines)
**Result:** -240 lines, single source of truth for ipcMain integration
test utilities.
## Copy-to-Clipboard Deduplication
The copy feedback pattern (`copied` state + 2000ms timeout) was
duplicated across 4 components with identical implementations.
- Created `src/hooks/useCopyToClipboard.ts` for reusable copy
functionality
- Added `COPY_FEEDBACK_DURATION_MS` constant to `src/constants/ui.ts`
- Updated AssistantMessage, UserMessage, ProposePlanToolCall,
FileEditToolCall
**Result:** 54 lines of duplicated code replaced with single 33-line
hook.
_Generated with `cmux`_
0 commit comments