From 3ce9a998ae454929207dd9add4a67b68dba13bc8 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Mon, 28 Jul 2025 09:14:11 -0400 Subject: [PATCH] fix(editor): Case-sensitive credential search in `NodeCredentials` component (#17564) --- .../editor-ui/src/components/NodeCredentials.test.ts | 9 +++++++++ .../editor-ui/src/components/NodeCredentials.vue | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/frontend/editor-ui/src/components/NodeCredentials.test.ts b/packages/frontend/editor-ui/src/components/NodeCredentials.test.ts index 831b175975..6c6526ea5f 100644 --- a/packages/frontend/editor-ui/src/components/NodeCredentials.test.ts +++ b/packages/frontend/editor-ui/src/components/NodeCredentials.test.ts @@ -232,6 +232,15 @@ describe('NodeCredentials', () => { expect(screen.queryByText('OpenAi account')).not.toBeInTheDocument(); expect(screen.queryByText('Test OpenAi account')).toBeInTheDocument(); + + await userEvent.keyboard('{Escape}'); + + await userEvent.click(credentialsSelect); + + await userEvent.type(credentialSearch, 'Test'); + + expect(screen.queryByText('OpenAi account')).not.toBeInTheDocument(); + expect(screen.queryByText('Test OpenAi account')).toBeInTheDocument(); }); it('should open the new credential modal when clicked', async () => { diff --git a/packages/frontend/editor-ui/src/components/NodeCredentials.vue b/packages/frontend/editor-ui/src/components/NodeCredentials.vue index f546d1cce8..1b4a6a77af 100644 --- a/packages/frontend/editor-ui/src/components/NodeCredentials.vue +++ b/packages/frontend/editor-ui/src/components/NodeCredentials.vue @@ -500,7 +500,7 @@ function setFilter(newFilter = '') { } function matches(needle: string, haystack: string) { - return haystack.toLocaleLowerCase().includes(needle); + return haystack.toLocaleLowerCase().includes(needle.toLocaleLowerCase()); } async function onClickCreateCredential(type: ICredentialType | INodeCredentialDescription) {