From 0c1f3acc7dcf92c739049d2a20d9a12135393b99 Mon Sep 17 00:00:00 2001 From: Gaurav <39389231+gsquared94@users.noreply.github.com> Date: Wed, 27 Aug 2025 10:13:38 -0700 Subject: [PATCH] fix: make test more reliable (#7233) --- packages/cli/src/ui/components/InputPrompt.test.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/ui/components/InputPrompt.test.tsx b/packages/cli/src/ui/components/InputPrompt.test.tsx index 994f2ba3..820243f0 100644 --- a/packages/cli/src/ui/components/InputPrompt.test.tsx +++ b/packages/cli/src/ui/components/InputPrompt.test.tsx @@ -1442,10 +1442,17 @@ describe('InputPrompt', () => { const { stdin, stdout, unmount } = renderWithProviders( , ); - stdin.write('\x12'); + + act(() => { + stdin.write('\x12'); + }); await wait(); + expect(stdout.lastFrame()).toContain('(r:)'); - stdin.write('\r'); + + act(() => { + stdin.write('\r'); + }); await waitFor(() => { expect(stdout.lastFrame()).not.toContain('(r:)');