fix(server): unstable test (#13436)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Improved test reliability by automatically cleaning up workspace
snapshots during embedding status checks in end-to-end tests.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-08-07 17:37:22 +08:00
committed by GitHub
parent ffbd21e42a
commit 94cf32ead2
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -152,6 +152,15 @@ export async function createRandomUser(): Promise<{
} as any;
}
export async function cleanupWorkspace(workspaceId: string): Promise<void> {
await runPrisma(async client => {
const ret = await client.snapshot.deleteMany({
where: { workspaceId, id: { not: workspaceId } },
});
console.error(ret);
});
}
export async function switchDefaultChatModel(model: string) {
await runPrisma(async client => {
const promptId = await client.aiPrompt