diff --git a/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddDropdown.svelte b/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddDropdown.svelte index e053e6f83..a6bb0fc2a 100644 --- a/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddDropdown.svelte +++ b/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddDropdown.svelte @@ -1,11 +1,14 @@ + + { + const textarea = await canvas.findByRole('textbox'); + await userEvent.clear(textarea); + await userEvent.type(textarea, 'What is the meaning of life?'); + + const trigger = await canvas.findByRole('button', { name: ATTACHMENT_TOOLTIP_TEXT }); + + trigger.focus(); + await expect(trigger).toHaveFocus(); + + await userEvent.tab(); + + await expect(trigger).not.toHaveFocus(); + }} +/> + + { + const trigger = await canvas.findByRole('button', { name: ATTACHMENT_TOOLTIP_TEXT }); + + trigger.focus(); + await userEvent.keyboard('{Enter}'); + await screen.findByRole('menu'); + + await waitFor(() => { + expect(document.activeElement).toHaveTextContent('Text Files'); + }); + }} +/>