From b08dd0088f86d1303e72d189fcea7657b71f8cbe Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 14 May 2026 18:07:03 +0200 Subject: [PATCH] test(playwright): await `setO(n|ff)line` in autosave tests Should fix flakyness of these tests Signed-off-by: Jonas --- playwright/e2e/autosave.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playwright/e2e/autosave.spec.ts b/playwright/e2e/autosave.spec.ts index 9a51a583709..7436e48b1e0 100644 --- a/playwright/e2e/autosave.spec.ts +++ b/playwright/e2e/autosave.spec.ts @@ -38,9 +38,9 @@ test('saves after being disconnected for 20 sec.', async ({ await expect(editor.el).toBeVisible() await editor.typeHeading('Hello world') await expect(editor.saveIndicator).toHaveAccessibleName(/Unsaved changes/) - setOffline() + await setOffline() await page.clock.fastForward(20_000) - setOnline() + await setOnline() await page.clock.fastForward(20_000) await expect(editor.saveIndicator).not.toHaveAccessibleName(/Unsaved changes/) // TODO: Why does this not work? await expect(await file.getContent()).toBe('## Hello world') @@ -56,9 +56,9 @@ test('saves after being disconnected for 2 minutes', async ({ await expect(editor.el).toBeVisible() await editor.typeHeading('Hello world') await expect(editor.saveIndicator).toHaveAccessibleName(/Unsaved changes/) - setOffline() + await setOffline() await page.clock.fastForward(120_000) - setOnline() + await setOnline() await page.clock.fastForward(40_000) await expect(editor.saveIndicator).not.toHaveAccessibleName(/Unsaved changes/) // TODO: Why does this not work? await expect(await file.getContent()).toBe('## Hello world')