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:
DarkSky
2026-07-30 19:56:48 +08:00
committed by GitHub
parent a1defa8a3b
commit dd1c8dc7dd
2 changed files with 40 additions and 23 deletions
@@ -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 });
}
}