diff --git a/electron/tests/e2e/thread.e2e.spec.ts b/electron/tests/e2e/thread.e2e.spec.ts index 75b90dc398..dfd131988e 100644 --- a/electron/tests/e2e/thread.e2e.spec.ts +++ b/electron/tests/e2e/thread.e2e.spec.ts @@ -25,9 +25,7 @@ test('Select GPT model from Hub and Chat with Invalid API Key', async ({ { timeout: TIMEOUT } ) - const APIKeyError = page.getByText( - `You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.` - ) + const APIKeyError = page.getByTestId('passthrough-error-message') await expect(APIKeyError).toBeVisible({ timeout: TIMEOUT, }) diff --git a/web/containers/ErrorMessage/index.test.tsx b/web/containers/ErrorMessage/index.test.tsx index 1ebb713fa3..fec3e15b40 100644 --- a/web/containers/ErrorMessage/index.test.tsx +++ b/web/containers/ErrorMessage/index.test.tsx @@ -49,11 +49,7 @@ describe('ErrorMessage Component', () => { render() - expect( - screen.getByText( - `You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.` - ) - ).toBeInTheDocument() + expect(screen.getByTestId('passthrough-error-message')).toBeInTheDocument() expect(screen.getByText('Settings')).toBeInTheDocument() }) diff --git a/web/containers/ErrorMessage/index.tsx b/web/containers/ErrorMessage/index.tsx index 4dc08e54fe..532f02259c 100644 --- a/web/containers/ErrorMessage/index.tsx +++ b/web/containers/ErrorMessage/index.tsx @@ -52,7 +52,7 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => { ) default: return ( -

+

{message.content[0]?.text?.value && ( )}