From 2a432b1e0a520f71ec4f87c18498686bc4220350 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 15:51:53 +0000 Subject: [PATCH] test(app): wait for the slash search itself before erasing it (#9790) The arrow-choice test waited for /tdd to leave the list as proof that the search had become "h". The option list is a FlatList that mounts only the rows near its scroll position: right after the arrows wrap to /exit at the top, /tdd at the bottom is unmounted while the search is still "". The wait then passed early, Backspace landed before the cursor reached the search, the /exit choice stood, and Enter archived the agent. The test now waits for a popover that shows /help with neither /tdd nor /exit, in one query. With the search at "" the list always mounts the bottom row or the chosen one; only the search "h" leaves both out. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- .../app/e2e/browser/composer-autocomplete.spec.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/app/e2e/browser/composer-autocomplete.spec.ts b/packages/app/e2e/browser/composer-autocomplete.spec.ts index bf854c89b..108433cda 100644 --- a/packages/app/e2e/browser/composer-autocomplete.spec.ts +++ b/packages/app/e2e/browser/composer-autocomplete.spec.ts @@ -788,11 +788,20 @@ test.describe("Composer autocomplete", () => { await input.press("ArrowDown"); await input.press("h"); // On web the search reads the cursor after paint, so the input's value runs ahead of - // the list. Wait on the list itself: /tdd is hidden only while the search is "h", and - // back only once the search is "" again. - await expect(popover.getByText("/tdd", { exact: true })).toHaveCount(0); + // the list. Wait on the list itself. The list mounts only the rows near its scroll + // position, so one missing row proves nothing: right after the arrows wrap to the top, + // /tdd at the bottom is unmounted while the search is still "". With the search at "", + // the list always mounts the bottom row (/tdd) or the chosen one (/exit); only the + // search "h" leaves both out. Check them in one query so no frame falls between them. + await expect( + popover.filter({ + has: page.getByText("/help", { exact: true }), + hasNot: page.getByText(/^\/(tdd|exit)$/), + }), + ).toBeVisible(); await input.press("Backspace"); await expect(input).toHaveValue("/"); + // /tdd is back only once the search is "" again. await expect(popover.getByText("/tdd", { exact: true }).first()).toBeVisible(); await input.press("Enter");