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");