mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
fix(frontend): keep the discard release from restarting the mic and let reduced motion stop the wave animation
This commit is contained in:
1 parent
99cc8a7f24
commit
095d3a6b37
3 files changed
+40
-6
No files matched your search
@@ -730,6 +730,39 @@ describe('PromptInput STT Gesture Tests', () => {
|
||||
expect(mockStopRecording).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('does not restart recording when the mic is tapped right after a drag-to-discard release', async () => {
|
||||
const view = renderRecorder({ isRecording: true })
|
||||
mockAbortRecording.mockClear()
|
||||
mockStartRecording.mockClear()
|
||||
|
||||
const container = getMobileVoiceButtonContainer()
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.pointerDown(container, { clientX: 200 })
|
||||
fireEvent.pointerMove(container, { clientX: 100 })
|
||||
})
|
||||
|
||||
expect(screen.getByText('Release to discard')).toBeInTheDocument()
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.pointerUp(container, { clientX: 100 })
|
||||
})
|
||||
|
||||
expect(mockAbortRecording).toHaveBeenCalledTimes(1)
|
||||
|
||||
view.rerender({ isRecording: false })
|
||||
|
||||
expect(screen.queryByRole('button', { name: 'Discard recording' })).not.toBeInTheDocument()
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(getMobileVoiceButton())
|
||||
await new Promise(resolve => setTimeout(resolve, 10))
|
||||
})
|
||||
|
||||
expect(mockStartRecording).not.toHaveBeenCalled()
|
||||
expect(screen.queryByRole('button', { name: 'Discard recording' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('leaves the desktop composer without the recorder row', () => {
|
||||
mocks.useMobile.mockReturnValue(false)
|
||||
|
||||
|
||||
Reference in new issue
Block a user