feat: add tests for /api/chat (#950)

This commit is contained in:
Jeremy 2025-04-22 18:55:17 -07:00 committed by GitHub
parent 4ca93aaf89
commit a159b77fcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 197 additions and 50 deletions

34
tests/fixtures.ts Normal file
View file

@ -0,0 +1,34 @@
import { expect as baseExpect, test as baseTest } from '@playwright/test';
import { createAuthenticatedContext, type UserContext } from './auth-helper';
interface Fixtures {
adaContext: UserContext;
babbageContext: UserContext;
}
export const test = baseTest.extend<any, Fixtures>({
adaContext: [
async ({ browser }, use) => {
const ada = await createAuthenticatedContext({
browser,
name: 'ada',
});
await use(ada);
await ada.context.close();
},
{ scope: 'worker' },
],
babbageContext: [
async ({ browser }, use) => {
const babbage = await createAuthenticatedContext({
browser,
name: 'babbage',
});
await use(babbage);
await babbage.context.close();
},
{ scope: 'worker' },
],
});
export const expect = baseExpect;