diff --git a/frontend/src/components/Chat/ChatInputArea.test.tsx b/frontend/src/components/Chat/ChatInputArea.test.tsx index 1c5c601b2a..9b34899fa2 100644 --- a/frontend/src/components/Chat/ChatInputArea.test.tsx +++ b/frontend/src/components/Chat/ChatInputArea.test.tsx @@ -753,7 +753,8 @@ describe("ChatInputArea", () => { expect(screen.getByTestId("converted-indicator")).toBeInTheDocument(); // Edit the converted value - const convertedInput = screen.getByTestId("converted-value-input"); + const convertedInput = screen.getByRole("textbox", { name: /converted prompt/i }); + expect(convertedInput).toHaveValue("aGVsbG8="); await user.clear(convertedInput); await user.type(convertedInput, "new"); expect(onConvertedValueChange).toHaveBeenCalled(); diff --git a/frontend/src/components/Chat/ChatInputArea.tsx b/frontend/src/components/Chat/ChatInputArea.tsx index db5eba03cd..d41cbc7ae3 100644 --- a/frontend/src/components/Chat/ChatInputArea.tsx +++ b/frontend/src/components/Chat/ChatInputArea.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useLayoutEffect, useRef, forwardRef, useImperativeHandle, KeyboardEvent, Ref } from 'react' +import { useState, useEffect, useLayoutEffect, useRef, useId, forwardRef, useImperativeHandle, KeyboardEvent, Ref } from 'react' import { Button, Caption1, @@ -241,6 +241,7 @@ interface TextInputRowsProps { function TextInputRows({ input, convertedValue, convertedFileChip, disabled, textareaRef, convertedRef, onInput, onKeyDown, onConvertedValueChange, onClearConvertedFileChip, styles, textInputClassName }: TextInputRowsProps) { const hasConversion = Boolean(convertedValue) || Boolean(convertedFileChip) + const convertedTextareaId = useId() return ( <>