test: correct test case
This commit is contained in:
parent
f227d35238
commit
60a888c9d7
@ -25,9 +25,7 @@ test('Select GPT model from Hub and Chat with Invalid API Key', async ({
|
|||||||
{ timeout: TIMEOUT }
|
{ timeout: TIMEOUT }
|
||||||
)
|
)
|
||||||
|
|
||||||
const APIKeyError = page.getByText(
|
const APIKeyError = page.getByTestId('passthrough-error-message')
|
||||||
`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({
|
await expect(APIKeyError).toBeVisible({
|
||||||
timeout: TIMEOUT,
|
timeout: TIMEOUT,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -49,11 +49,7 @@ describe('ErrorMessage Component', () => {
|
|||||||
|
|
||||||
render(<ErrorMessage message={message} />)
|
render(<ErrorMessage message={message} />)
|
||||||
|
|
||||||
expect(
|
expect(screen.getByTestId('invalid-API-key-error')).toBeInTheDocument()
|
||||||
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()
|
expect(screen.getByText('Settings')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
|||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
return (
|
return (
|
||||||
<p>
|
<p data-testid="passthrough-error-message">
|
||||||
{message.content[0]?.text?.value && (
|
{message.content[0]?.text?.value && (
|
||||||
<AutoLink text={message.content[0].text.value} />
|
<AutoLink text={message.content[0].text.value} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user