fix: make test more reliable (#7233)
This commit is contained in:
parent
99a28e6b6a
commit
0c1f3acc7d
1 changed files with 9 additions and 2 deletions
|
|
@ -1442,10 +1442,17 @@ describe('InputPrompt', () => {
|
||||||
const { stdin, stdout, unmount } = renderWithProviders(
|
const { stdin, stdout, unmount } = renderWithProviders(
|
||||||
<InputPrompt {...props} />,
|
<InputPrompt {...props} />,
|
||||||
);
|
);
|
||||||
stdin.write('\x12');
|
|
||||||
|
act(() => {
|
||||||
|
stdin.write('\x12');
|
||||||
|
});
|
||||||
await wait();
|
await wait();
|
||||||
|
|
||||||
expect(stdout.lastFrame()).toContain('(r:)');
|
expect(stdout.lastFrame()).toContain('(r:)');
|
||||||
stdin.write('\r');
|
|
||||||
|
act(() => {
|
||||||
|
stdin.write('\r');
|
||||||
|
});
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(stdout.lastFrame()).not.toContain('(r:)');
|
expect(stdout.lastFrame()).not.toContain('(r:)');
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue