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

solid-reactive-chat.spec.ts

17 lines571 Bytes

1import { expect, test } from '@playwright/test'
2​
3test('Solid useChat keeps history after a reactive body update', async ({
4 page,
5}) => {
6 await page.goto('/solid-reactive-chat')
7 await page.getByTestId('send-first').click()
8 await expect(page.getByTestId('requests')).toHaveText(
9 '[{"users":1,"provider":"openai"}]',
10 )
11​
12 await page.getByTestId('change-provider').click()
13 await page.getByTestId('send-second').click()
14 await expect(page.getByTestId('requests')).toHaveText(
15 '[{"users":1,"provider":"openai"},{"users":2,"provider":"anthropic"}]',
16 )
17})