Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

test(open-knowledge): fix file-tree-drag-to-root strict-mode flake (#1963)

Nick Gomezbd9f2fac0267
diff --git a/packages/app/tests/stress/file-tree-drag-to-root.e2e.ts b/packages/app/tests/stress/file-tree-drag-to-root.e2e.ts
index 9136ed6ac..3e9cafcd6 100644
--- a/packages/app/tests/stress/file-tree-drag-to-root.e2e.ts
+++ b/packages/app/tests/stress/file-tree-drag-to-root.e2e.ts
@@ -145,7 +145,10 @@ test.describe('file-tree drag-to-root (PRD-7043)', () => {
absent: 'parent/child/note',
});
- await expect(sidebar.getByRole('treeitem', { name: 'child', exact: true })).toBeVisible({
+ await expect(sidebar.locator('[role="treeitem"][data-item-path="child/"]')).toBeVisible({
+ timeout: 10_000,
+ });
+ await expect(sidebar.getByRole('treeitem', { name: 'child', exact: true })).toHaveCount(1, {
timeout: 10_000,
});
});
@@ -174,7 +177,10 @@ test.describe('file-tree drag-to-root (PRD-7043)', () => {
await expectDocNames(page, workerServer.baseURL, { present: 'note', absent: 'folder/note' });
- await expect(sidebar.getByRole('treeitem', { name: 'note.md', exact: true })).toBeVisible({
+ await expect(sidebar.locator('[role="treeitem"][data-item-path="note.md"]')).toBeVisible({
+ timeout: 10_000,
+ });
+ await expect(sidebar.getByRole('treeitem', { name: 'note.md', exact: true })).toHaveCount(1, {
timeout: 10_000,
});
});