From a8a04707931e637d279a7084331e6dc0d9e2dc75 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:58:57 +0100 Subject: [PATCH] test: wait for the recent files list in the Attach menu tests, so a busy runner doesn't time them out --- .../email/__tests__/composer-attach-recent.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/email/__tests__/composer-attach-recent.test.tsx b/components/email/__tests__/composer-attach-recent.test.tsx index 8a61dcd26..5be54abfa 100644 --- a/components/email/__tests__/composer-attach-recent.test.tsx +++ b/components/email/__tests__/composer-attach-recent.test.tsx @@ -386,7 +386,7 @@ describe('recent files in the Attach menu', () => { expect(document.activeElement).toHaveAttribute('data-testid', 'composer-attach-from-device'); fireEvent.keyDown(document.activeElement!, { key: 'Escape' }); expect(screen.queryByRole('menu')).toBeNull(); - }); + }, 15_000); it('stays an HTML menu where the shell would draw it natively', async () => { const popup = vi.fn(async () => null); @@ -394,8 +394,8 @@ describe('recent files in the Attach menu', () => { useAuthStore.setState({ client: client() as never }); render(); await openMenu(); - await act(async () => { await new Promise((resolve) => setTimeout(resolve, 300)); }); + // The list arrives from the shell after the menu opens; on a busy runner that takes a while. + await waitFor(() => expect(rows()).toHaveLength(2), { timeout: 10_000 }); expect(popup).not.toHaveBeenCalled(); - expect(rows()).toHaveLength(2); - }); + }, 15_000); });