Fix flake due to using wait instead of waitFor (#6277)

This commit is contained in:
Jacob Richman 2025-08-14 16:39:12 -07:00 committed by GitHub
parent 8c0c8d7770
commit a5c81e3fe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -1217,17 +1217,18 @@ describe('InputPrompt', () => {
props.buffer.setText('some text');
const { stdin, unmount } = render(<InputPrompt {...props} />);
await wait();
stdin.write('\x1B');
await wait();
expect(onEscapePromptChange).toHaveBeenCalledWith(true);
await waitFor(() => {
expect(onEscapePromptChange).toHaveBeenCalledWith(true);
});
stdin.write('a');
await wait();
expect(onEscapePromptChange).toHaveBeenCalledWith(false);
await waitFor(() => {
expect(onEscapePromptChange).toHaveBeenCalledWith(false);
});
unmount();
});