diff --git a/frontend/src/components/Chat/ChatInputArea.test.tsx b/frontend/src/components/Chat/ChatInputArea.test.tsx index c4c893cc9..13f1ba8ae 100644 --- a/frontend/src/components/Chat/ChatInputArea.test.tsx +++ b/frontend/src/components/Chat/ChatInputArea.test.tsx @@ -223,10 +223,26 @@ describe("ChatInputArea", () => { ); - const attachButton = screen.getByTitle("Attach files"); + const attachButton = screen.getByRole("button", { name: /attach files/i }); expect(attachButton).toBeInTheDocument(); }); + it("should expose all icon-only buttons via aria-label, not only title", () => { + // Regression guard against using only `title=` for icon buttons. + // `title` is not a reliable accessible name for screen readers; aria-label + // is. All icon-only buttons in the input area must be reachable by role + // + name (i.e., they have an aria-label that matches the visible tooltip). + render( + + + + ); + + expect(screen.getByRole("button", { name: /attach files/i })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /toggle converter panel/i })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /send message/i })).toBeInTheDocument(); + }); + it("should handle file attachment selection", async () => { const user = userEvent.setup(); @@ -478,7 +494,7 @@ describe("ChatInputArea", () => { }); // Send button should be enabled since there's an attachment - expect(screen.getByTitle("Send message")).toBeEnabled(); + expect(screen.getByRole("button", { name: /send message/i })).toBeEnabled(); }); it("should show single-turn banner when singleTurnLimitReached is true", () => { diff --git a/frontend/src/components/Chat/ChatInputArea.tsx b/frontend/src/components/Chat/ChatInputArea.tsx index 82c1817e6..749a7b8ee 100644 --- a/frontend/src/components/Chat/ChatInputArea.tsx +++ b/frontend/src/components/Chat/ChatInputArea.tsx @@ -475,23 +475,27 @@ const ChatInputArea = forwardRef(functi />
-
(functi )} -