feat: init element for new thread
This commit is contained in:
parent
bb567ce8c4
commit
ed7ba2cbf1
25
electron/tests/e2e/thread.e2e.spec.ts
Normal file
25
electron/tests/e2e/thread.e2e.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { expect } from '@playwright/test'
|
||||||
|
import { page, test, TIMEOUT } from '../config/fixtures'
|
||||||
|
|
||||||
|
test('create thread button', async () => {
|
||||||
|
const settingsBtn = await page
|
||||||
|
.getByTestId('btn-create-thread')
|
||||||
|
.click()
|
||||||
|
await page
|
||||||
|
.getByTestId('txt-input-chat')
|
||||||
|
.fill('dummy value')
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByTestId('btn-send-chat')
|
||||||
|
.click()
|
||||||
|
|
||||||
|
expect([settingsBtn].filter((e) => !e).length).toBe(0)
|
||||||
|
// Chat section should be there
|
||||||
|
await page.getByTestId('Local API Server').first().click({
|
||||||
|
timeout: TIMEOUT,
|
||||||
|
})
|
||||||
|
const localServer = page.getByTestId('local-server-testid').first()
|
||||||
|
await expect(localServer).toBeVisible({
|
||||||
|
timeout: TIMEOUT,
|
||||||
|
})
|
||||||
|
})
|
||||||
@ -148,6 +148,7 @@ const ChatInput: React.FC = () => {
|
|||||||
'max-h-[400px] resize-none pr-20',
|
'max-h-[400px] resize-none pr-20',
|
||||||
fileUpload.length && 'rounded-t-none'
|
fileUpload.length && 'rounded-t-none'
|
||||||
)}
|
)}
|
||||||
|
data-testid="txt-input-chat"
|
||||||
style={{ height: '40px' }}
|
style={{ height: '40px' }}
|
||||||
ref={textareaRef}
|
ref={textareaRef}
|
||||||
onKeyDown={onKeyDown}
|
onKeyDown={onKeyDown}
|
||||||
@ -320,6 +321,7 @@ const ChatInput: React.FC = () => {
|
|||||||
}
|
}
|
||||||
themes="primary"
|
themes="primary"
|
||||||
className="min-w-[100px]"
|
className="min-w-[100px]"
|
||||||
|
data-testid="btn-send-chat"
|
||||||
onClick={() => sendChatMessage(currentPrompt)}
|
onClick={() => sendChatMessage(currentPrompt)}
|
||||||
>
|
>
|
||||||
Send
|
Send
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user