mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 17:39:55 +08:00
fix(editor): test stability (#15377)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved automated validation for AI file embedding readiness. * Expanded coverage for paragraph behavior when converting between list types and deleting content. * Strengthened checks for block structure and formatting outcomes to help prevent regressions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { cleanupWorkspace } from '@affine-test/kit/utils/cloud';
|
||||
import { cleanupWorkspace, runPrisma } from '@affine-test/kit/utils/cloud';
|
||||
import { expect, type Page } from '@playwright/test';
|
||||
|
||||
const WORKSPACE_EMBEDDING_SWITCH_TEST_ID = 'workspace-embedding-setting-switch';
|
||||
@@ -268,6 +268,15 @@ export class SettingsPanelUtils {
|
||||
await expect(attachmentItems).toHaveCount(expectedFileCount);
|
||||
}).toPass({ timeout });
|
||||
|
||||
await this.waitForEmbeddingComplete(page, timeout);
|
||||
const workspaceId = page.url().split('/').slice(-2)[0] || '';
|
||||
await cleanupWorkspace(workspaceId);
|
||||
await expect(async () => {
|
||||
const embeddedFileCount = await runPrisma(client =>
|
||||
client.aiWorkspaceFiles.count({
|
||||
where: { workspaceId, embeddings: { some: {} } },
|
||||
})
|
||||
);
|
||||
expect(embeddedFileCount).toBe(expectedFileCount);
|
||||
}).toPass({ timeout });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user