diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index ebc781e8eba..6f82da00d72 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -32,6 +32,7 @@ interface ChatTextAreaProps { inputValue: string setInputValue: (value: string) => void textAreaDisabled: boolean + selectApiConfigDisabled: boolean placeholderText: string selectedImages: string[] setSelectedImages: React.Dispatch> @@ -50,6 +51,7 @@ const ChatTextArea = forwardRef( inputValue, setInputValue, textAreaDisabled, + selectApiConfigDisabled, placeholderText, selectedImages, setSelectedImages, @@ -975,7 +977,7 @@ const ChatTextArea = forwardRef(
{ setInputValue: jest.fn(), onSend: jest.fn(), textAreaDisabled: false, + selectApiConfigDisabled: false, onSelectImages: jest.fn(), shouldDisableImages: false, placeholderText: "Type a message...", @@ -408,4 +409,21 @@ describe("ChatTextArea", () => { expect(setInputValue).not.toHaveBeenCalled() }) }) + + describe("selectApiConfig", () => { + // Helper function to get the API config dropdown + const getApiConfigDropdown = () => { + return screen.getByTitle("chat:selectApiConfig") + } + it("should be enabled independently of textAreaDisabled", () => { + render() + const apiConfigDropdown = getApiConfigDropdown() + expect(apiConfigDropdown).not.toHaveAttribute("disabled") + }) + it("should be disabled when selectApiConfigDisabled is true", () => { + render() + const apiConfigDropdown = getApiConfigDropdown() + expect(apiConfigDropdown).toHaveAttribute("disabled") + }) + }) })