mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat(ui): app-wide keyboard shortcuts with TUI keybind import
This commit is contained in:
1 parent
b18e4f13b3
commit
b06de60f6b
38 files changed
+2467
-440
No files matched your search
@@ -422,6 +422,30 @@ describe('PromptInput command submission', () => {
|
||||
expect(screen.getByTestId('model-quick-select')).toHaveAttribute('data-open', 'true')
|
||||
})
|
||||
|
||||
it('resets bash mode through the imperative clearPrompt', async () => {
|
||||
const queryClient = createTestQueryClient()
|
||||
queryClient.setQueryData(['opencode', 'session', 'test-session', '/test'], sessionInfo())
|
||||
const ref = createRef<PromptInputHandle>()
|
||||
|
||||
render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<PromptInput {...defaultProps} ref={ref} />
|
||||
</QueryClientProvider>
|
||||
)
|
||||
|
||||
const input = await screen.findByPlaceholderText('Send a message...')
|
||||
fireEvent.change(input, { target: { value: '!' } })
|
||||
expect(input).toHaveValue('!')
|
||||
expect(screen.getByTestId('composer-mode-badge')).toHaveTextContent('BASH')
|
||||
|
||||
act(() => {
|
||||
ref.current?.clearPrompt()
|
||||
})
|
||||
|
||||
expect(input).toHaveValue('')
|
||||
expect(screen.queryByTestId('composer-mode-badge')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('keeps attachments and clears only the text when a built-in command is submitted', async () => {
|
||||
const { container } = renderComponent()
|
||||
|
||||
|
||||
Reference in new issue
Block a user