Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: improve sync test reliability

Abdullah Atta9926c0b6da31
diff --git a/apps/web/__e2e__/sync.test.ts b/apps/web/__e2e__/sync.test.ts
index 48d8bb4f9..46ce4f1b3 100644
--- a/apps/web/__e2e__/sync.test.ts
+++ b/apps/web/__e2e__/sync.test.ts
@@ -69,7 +69,8 @@ test(`edits in a note opened on 2 devices should sync in real-time`, async ({
const noteA = await notesA.findNote(NOTE);
await Promise.all([noteA, noteB].map((note) => note?.openNote()));
- await actAndSync([deviceA, deviceB], notesB.editor.clear());
+ if ((await notesB.editor.getContent("text")) !== "")
+ await actAndSync([deviceA, deviceB], notesB.editor.clear());
expect(await notesA.editor.getContent("text")).toBe("");
expect(await notesB.editor.getContent("text")).toBe("");
await actAndSync([deviceA, deviceB], notesB.editor.setContent(newContent));