Skip to content

Build your personal knowledge base with Trilium Notes

e2e(server): fix flaky test

Elian Doran818ca2c2abaf
diff --git a/apps/server-e2e/src/duplicate.spec.ts b/apps/server-e2e/src/duplicate.spec.ts
index 56c1709605..b7ca06aacd 100644
--- a/apps/server-e2e/src/duplicate.spec.ts
+++ b/apps/server-e2e/src/duplicate.spec.ts
@@ -9,6 +9,8 @@ test("Can duplicate note with broken links", async ({ page, context }) => {
await app.noteTree.getByText("Note map").first().click({ button: "right" });
await page.locator("#context-menu-container").getByText("Duplicate").click();
- await expect(page.locator(".toast-body")).toBeHidden();
- await expect(app.noteTree.getByText("Note map (dup)")).toBeVisible();
+ await expect(page.locator(".toast-body", {
+ hasText: `Note "Note map" has been`
+ })).toBeHidden();
+ await expect(app.noteTree.getByText("Note map (dup)").first()).toBeVisible();
});