From e7b2ec7757a9b932f6b6cebd7a6a7a22b7c15389 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2026 11:38:24 +0200 Subject: [PATCH] test(app): narrow the composer last so no step races the layout remount Crossing back from the mobile to the desktop breakpoint replaces the composer textarea about 200ms later. The next step filled the composer during that window on a slow CI runner and the new text landed before the old draft. Narrowing is now the final step, so no action follows the layout switch. --- .../e2e/browser/composer-whitespace.spec.ts | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/app/e2e/browser/composer-whitespace.spec.ts b/packages/app/e2e/browser/composer-whitespace.spec.ts index 024446967f..57951b8289 100644 --- a/packages/app/e2e/browser/composer-whitespace.spec.ts +++ b/packages/app/e2e/browser/composer-whitespace.spec.ts @@ -65,19 +65,6 @@ test("blank composer lines remain present and keep their measured height", async const blankLines = "\n\n\n\n\n"; const collapsedHeight = await composerHeight(page); - await test.step("remeasure the current draft when the window narrows", async () => { - await page.setViewportSize({ width: 1280, height: 1200 }); - const text = "A sentence that wraps when the editor becomes narrower. ".repeat(8); - await composer.fill(text); - await expect(composer).toHaveValue(text); - await expect.poll(() => composerHeight(page)).toBeGreaterThan(collapsedHeight); - const wideHeight = await composerHeight(page); - await page.setViewportSize({ width: 480, height: 1200 }); - await expect.poll(() => composerHeight(page)).toBeGreaterThan(wideHeight); - await expect(composer).toHaveValue(text); - await page.setViewportSize({ width: 1280, height: 720 }); - }); - await test.step("grow the composer with blank lines followed by text", async () => { await composer.fill(`${blankLines}x`); await expect(composer).toHaveValue(`${blankLines}x`); @@ -101,6 +88,18 @@ test("blank composer lines remain present and keep their measured height", async await expect(composer).toHaveValue("alpha\nbeta\nx"); expect(filledTrailingLineHeight).toBe(trailingLineHeight); }); + + await test.step("remeasure the current draft when the window narrows", async () => { + await page.setViewportSize({ width: 1280, height: 1200 }); + const text = "A sentence that wraps when the editor becomes narrower. ".repeat(8); + await composer.fill(text); + await expect(composer).toHaveValue(text); + await expect.poll(() => composerHeight(page)).toBeGreaterThan(collapsedHeight); + const wideHeight = await composerHeight(page); + await page.setViewportSize({ width: 480, height: 1200 }); + await expect.poll(() => composerHeight(page)).toBeGreaterThan(wideHeight); + await expect(composer).toHaveValue(text); + }); } finally { await agent.cleanup(); }