mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Fix flake due to using wait instead of waitFor (#6277)
This commit is contained in:
@@ -1217,17 +1217,18 @@ describe('InputPrompt', () => {
|
|||||||
props.buffer.setText('some text');
|
props.buffer.setText('some text');
|
||||||
|
|
||||||
const { stdin, unmount } = render(<InputPrompt {...props} />);
|
const { stdin, unmount } = render(<InputPrompt {...props} />);
|
||||||
await wait();
|
|
||||||
|
|
||||||
stdin.write('\x1B');
|
stdin.write('\x1B');
|
||||||
await wait();
|
|
||||||
|
|
||||||
expect(onEscapePromptChange).toHaveBeenCalledWith(true);
|
await waitFor(() => {
|
||||||
|
expect(onEscapePromptChange).toHaveBeenCalledWith(true);
|
||||||
|
});
|
||||||
|
|
||||||
stdin.write('a');
|
stdin.write('a');
|
||||||
await wait();
|
|
||||||
|
|
||||||
expect(onEscapePromptChange).toHaveBeenCalledWith(false);
|
await waitFor(() => {
|
||||||
|
expect(onEscapePromptChange).toHaveBeenCalledWith(false);
|
||||||
|
});
|
||||||
unmount();
|
unmount();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user