diff --git a/apps/desktop/src/components/desktop-install-overlay.test.tsx b/apps/desktop/src/components/desktop-install-overlay.test.tsx index 1039e6e4ac..db67e72b6a 100644 --- a/apps/desktop/src/components/desktop-install-overlay.test.tsx +++ b/apps/desktop/src/components/desktop-install-overlay.test.tsx @@ -567,9 +567,12 @@ describe('DesktopInstallOverlay first-run setup', () => { expect(await screen.findByText('Installation failed')).toBeTruthy() - fireEvent.keyDown(window, { key: 'Escape' }) - - await waitFor(() => expect(screen.queryByText('Installation failed')).toBeNull()) + // The Escape listener is bound in a passive effect that can flush after the failed state is + // already painted; a key landing in that gap is (correctly) ignored, so press until it is heard. + await waitFor(() => { + fireEvent.keyDown(window, { key: 'Escape' }) + expect(screen.queryByText('Installation failed')).toBeNull() + }) }) })