Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

test: fix flaky (#3100)

Alex Yangc4d53d59b52f
diff --git a/tests/parallels/local-first-collections-items.spec.ts b/tests/parallels/local-first-collections-items.spec.ts
index c70278d637..f769574baf 100644
--- a/tests/parallels/local-first-collections-items.spec.ts
+++ b/tests/parallels/local-first-collections-items.spec.ts
@@ -63,6 +63,7 @@ test('Show collections items in sidebar', async ({ page }) => {
.getByTestId('collection-option')
.getByText('Delete');
await deleteCollection.click();
+ await page.waitForTimeout(50);
expect(await items.count()).toBe(0);
});
@@ -71,6 +72,7 @@ test('pin and unpin collection', async ({ page }) => {
await createAndPinCollection(page, { collectionName: name });
const collections = page.getByTestId('collections');
const items = collections.getByTestId('collection-item');
+ await page.waitForTimeout(50);
expect(await items.count()).toBe(1);
const first = items.first();
await first.getByTestId('collection-options').click();
@@ -78,6 +80,7 @@ test('pin and unpin collection', async ({ page }) => {
.getByTestId('collection-option')
.getByText('Unpin');
await deleteCollection.click();
+ await page.waitForTimeout(50);
expect(await items.count()).toBe(0);
await page.getByTestId('collection-select').click();
const option = page.locator('[data-testid=collection-select-option]', {