mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
chore(tests): add e2e tests for messaging suite (#387)
* feat(NewConversationMenu): add id to the new conversation menu button refactor(EndpointItem): remove onSelect prop and setTokenDialogOpen state variable test(messages.spec.js): add e2e test for messaging suite to check if textbox is focused after receiving message * test(Input): add test id to input field for e2e testing test(messages.spec.js): add endpoint variable and refactor test to check if textbox is focused after receiving message * test(messages.spec.js): refactor test to use a variable for message content Refactored the test to use a variable for message content instead of a hardcoded string.
This commit is contained in:
parent
c0845ad0b1
commit
fd5afc09a2
4 changed files with 50 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ const alternateName = {
|
|||
google: 'PaLM'
|
||||
};
|
||||
|
||||
export default function ModelItem({ endpoint, value, onSelect }) {
|
||||
export default function ModelItem({ endpoint, value }) {
|
||||
const [setTokenDialogOpen, setSetTokenDialogOpen] = useState(false);
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ export default function ModelItem({ endpoint, value, onSelect }) {
|
|||
<>
|
||||
<DropdownMenuRadioItem
|
||||
value={value}
|
||||
id={endpoint}
|
||||
className="group dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800"
|
||||
>
|
||||
{icon}
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ export default function NewConversationMenu() {
|
|||
<DropdownMenu open={menuOpen} onOpenChange={setMenuOpen}>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
id="new-conversation-menu"
|
||||
variant="outline"
|
||||
className={`group relative mb-[-12px] ml-0 mt-[-8px] items-center rounded-md border-0 p-1 outline-none focus:ring-0 focus:ring-offset-0 dark:data-[state=open]:bg-opacity-50 md:left-1 md:ml-[-12px] md:pl-1`}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ export default function TextChat({ isSearchView = false }) {
|
|||
>
|
||||
<NewConversationMenu />
|
||||
<TextareaAutosize
|
||||
// set test id for e2e testing
|
||||
data-testid="text-input"
|
||||
tabIndex="0"
|
||||
autoFocus
|
||||
ref={inputRef}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue