Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

chat-client-watcher-status.spec.ts

17 lines558 Bytes

1import { expect, test } from '@playwright/test'
2​
3test('a ChatClient that only watches returns to ready after every run', async ({
4 page,
5}) => {
6 await page.goto('/chat-client-watcher-status')
7 const run = page.getByTestId('run')
8 await expect(run).toBeEnabled()
9​
10 await run.click()
11 await expect(page.getByTestId('answers')).toHaveText('1')
12 await expect(page.getByTestId('status')).toHaveText('ready')
13​
14 await run.click()
15 await expect(page.getByTestId('answers')).toHaveText('2')
16 await expect(page.getByTestId('status')).toHaveText('ready')
17})