test: update test case

This commit is contained in:
Louis 2024-11-25 21:21:11 +07:00
parent aa175000e3
commit f227d35238
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 8 additions and 2 deletions

View File

@ -25,7 +25,9 @@ test('Select GPT model from Hub and Chat with Invalid API Key', async ({
{ timeout: TIMEOUT }
)
const APIKeyError = page.getByTestId('invalid-API-key-error')
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.`
)
await expect(APIKeyError).toBeVisible({
timeout: TIMEOUT,
})

View File

@ -49,7 +49,11 @@ describe('ErrorMessage Component', () => {
render(<ErrorMessage message={message} />)
expect(screen.getByTestId('invalid-API-key-error')).toBeInTheDocument()
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.getByText('Settings')).toBeInTheDocument()
})