diff --git a/client/src/components/Collab/CollabChat.test.tsx b/client/src/components/Collab/CollabChat.test.tsx index 2b1230be5..ff341e9b3 100644 --- a/client/src/components/Collab/CollabChat.test.tsx +++ b/client/src/components/Collab/CollabChat.test.tsx @@ -288,6 +288,14 @@ describe('CollabChat', () => { expect(screen.getByText(/deleted/i)).toBeInTheDocument(); }); + it('FE-COMP-CHAT-038: the send button keeps the focus in the message field', async () => { + render(); + await screen.findByText('Start the conversation'); + fireEvent.change(screen.getByPlaceholderText('Type a message...'), { target: { value: 'One more' } }); + const sendButton = screen.getAllByRole('button').find(b => b.querySelector('.lucide-arrow-up')); + expect(sendButton && fireEvent.mouseDown(sendButton)).toBe(false); + }); + it('FE-COMP-CHAT-020: send button is disabled when input is empty', async () => { render(); await screen.findByText('Start the conversation'); diff --git a/client/src/components/Collab/CollabChat.tsx b/client/src/components/Collab/CollabChat.tsx index 3aa3342c6..2f8c090a1 100644 --- a/client/src/components/Collab/CollabChat.tsx +++ b/client/src/components/Collab/CollabChat.tsx @@ -85,7 +85,7 @@ export default function CollabChat({ tripId, currentUser }: CollabChatProps) { {/* Send */} {canEdit && ( -