feat(db & e2e): Enhance DB Schemas/Controllers and Improve E2E Tests (#966)

* feat: add global teardown to remove test data and add registration/log-out to auth flow

* refactor(models/Conversation): index user field and add JSDoc to deleteConvos

* refactor: add user index to message schema and ensure user is saved to each Message

* refactor: add user to each saveMessage call

* fix: handle case where title is null in zod schema

* feat(e2e): ensure messages are deleted on cleanUp

* fix: set last convo for all endpoints on conversation update

* fix: enable registration for CI env
This commit is contained in:
Danny Avila 2023-09-18 15:19:50 -04:00 committed by GitHub
parent fd70e21732
commit 6358383001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 229 additions and 72 deletions

View file

@ -73,7 +73,7 @@ export const tMessageSchema = z.object({
overrideParentMessageId: z.string().nullable().optional(),
bg: z.string().nullable().optional(),
model: z.string().nullable().optional(),
title: z.string().nullable().optional(),
title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
sender: z.string(),
text: z.string(),
generation: z.string().nullable().optional(),
@ -103,7 +103,7 @@ export type TMessage = z.input<typeof tMessageSchema> & {
export const tConversationSchema = z.object({
conversationId: z.string().nullable(),
title: z.string(),
title: z.string().nullable().or(z.literal('New Chat')).default('New Chat'),
user: z.string().optional(),
endpoint: eModelEndpointSchema.nullable(),
suggestions: z.array(z.string()).optional(),