From fc9ab5b237bfeee1f064991815e7d950cb1357f9 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Wed, 15 Jul 2026 10:53:31 +0200 Subject: [PATCH] test(e2e): deflake dark-mode by awaiting full editor close in createNote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit createNote returned as soon as the note card appeared (editor merely "closing"), but the editor now dismisses via an async history.back() plus a 400ms onClose (added with close-on-back navigation, #71). A following page.goto could race that in-flight navigation and abort it (net::ERR_ABORTED) — surfacing only under the slower coverage-instrumented CI build. Wait for the editor overlay to fully unmount so the close navigation settles before createNote returns. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/e2e/helpers/fixtures.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/e2e/helpers/fixtures.ts b/tests/e2e/helpers/fixtures.ts index a1d3baf..084702f 100644 --- a/tests/e2e/helpers/fixtures.ts +++ b/tests/e2e/helpers/fixtures.ts @@ -104,6 +104,11 @@ export async function createNote(page: Page, title: string, content?: string) { await editor.pressSequentially(content); } await page.getByTestId('close-editor-btn').click(); + // Wait for the editor to fully unmount, not just start closing. The close is + // animated and dismisses via an async history.back() (see NoteEditor); returning + // before it settles lets a following page.goto race that navigation and abort it + // (net::ERR_ABORTED). The outer overlay is removed only when the close completes. + await expect(page.getByTestId('note-editor-overlay')).toHaveCount(0); await expect(noteCard(page, title)).toBeVisible(); }