feat: init element for new thread

This commit is contained in:
Van-QA 2024-04-10 14:24:55 +07:00
parent bb567ce8c4
commit ed7ba2cbf1
2 changed files with 27 additions and 0 deletions

View 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,
})
})

View File

@ -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