Skip to content

Commit 5b35ac2

Browse files
test(chat): dictation inserts into composer, not auto-send (B26 — align stale rntl test)
The landed B26 chat-mode dictation change places a standalone dictation into the composer (the user expects the spoken words in the input box) rather than auto-sending. Updated the stale ChatInput rntl test to assert the ratified behavior (composer value set, onSend not called). rntl suite 1820/1820. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5d16202 commit 5b35ac2

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

__tests__/rntl/components/ChatInput.test.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ describe('ChatInput', () => {
13451345
expect(mockStartRecording).toHaveBeenCalled();
13461346
});
13471347

1348-
it('auto-sends a standalone chat-mode dictation instead of inserting it into the composer', () => {
1348+
it('inserts a standalone chat-mode dictation into the composer (does NOT auto-send)', () => {
13491349
const mockClearResult = jest.fn();
13501350
const onSend = jest.fn();
13511351
// First render: no finalResult, empty composer (standalone).
@@ -1385,14 +1385,12 @@ describe('ChatInput', () => {
13851385

13861386
rerender(<ChatInput {...defaultProps} onSend={onSend} conversationId="conv-123" />);
13871387

1388-
// Standalone dictation auto-sends as a plain text message (no audio file
1389-
// on the whisper path) and does NOT sit in the composer.
1390-
expect(onSend).toHaveBeenCalledTimes(1);
1391-
const [text, attachments] = onSend.mock.calls[0];
1392-
expect(text).toBe('Hello from voice');
1393-
expect(attachments ?? []).toHaveLength(0);
1388+
// B26: chat-mode hold-to-talk dictation places the transcript INTO the composer for the
1389+
// user to review and send (the user spoke and expects the words in the input box) — it
1390+
// does NOT auto-send. The transcript is consumed (clearResult) into the input value.
1391+
expect(onSend).not.toHaveBeenCalled();
13941392
const input = getByTestId('chat-input');
1395-
expect(input.props.value).toBe('');
1393+
expect(input.props.value).toBe('Hello from voice');
13961394
expect(mockClearResult).toHaveBeenCalled();
13971395
});
13981396

0 commit comments

Comments
 (0)