Fix flake due to using wait instead of waitFor (#6277)
This commit is contained in:
parent
8c0c8d7770
commit
a5c81e3fe0
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue