From cec67b33543aee38053294f80427f55c1d3ec616 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 26 Dec 2023 11:49:29 +0500 Subject: [PATCH] web: improve sync test reliability --- apps/web/__e2e__/sync.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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));