Skip to content

Commit

Permalink
chore: add wait time for loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Van-QA committed Apr 11, 2024
1 parent 57010de commit e86813f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electron/tests/e2e/thread.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from '@playwright/test'
import { page, test, TIMEOUT } from '../config/fixtures'

test('Select GPT model for chat via Use model button from Jan Hub', async ({ hubPage }) => {
test('Select GPT model from Hub and Chat with Invalid API Key', async ({ hubPage }) => {
await hubPage.navigateByMenu()
await hubPage.verifyContainerVisible()

Expand All @@ -23,6 +23,8 @@ test('Select GPT model for chat via Use model button from Jan Hub', async ({ hub
.getByTestId('btn-send-chat')
.click()

await page.waitForSelector('[data-testid$="-loader"]', { state: 'hidden', timeout: TIMEOUT });

const APIKeyError = page.getByTestId('invalid-API-key-error')
await expect(APIKeyError).toBeVisible({
timeout: TIMEOUT,
Expand Down
1 change: 1 addition & 0 deletions web/containers/Loader/GenerateResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function GenerateResponse() {
<div
className="absolute left-0 top-0 h-full bg-gray-200"
style={{ width: `${loader}%` }}
data-testid="response-loader"
/>
<span className="relative z-10">Generating response...</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/containers/Loader/ModelStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function ModelStart() {
<div
className="absolute left-0 top-0 h-full bg-blue-200"
style={{ width: `${loader}%` }}
data-testid="model-loader"
/>
<span className="relative z-10">
{stateModel.state === 'start' ? 'Starting' : 'Stopping'}
Expand Down

0 comments on commit e86813f

Please sign in to comment.