fix: macos test

This commit is contained in:
Nate 2025-07-19 23:05:31 -07:00
parent 00c646e67a
commit 4de1784780

View file

@ -17,15 +17,21 @@ describe("TUIChat - User Input Tests", () => {
});
it("clears input field after pressing Enter", async () => {
const { lastFrame, stdin } = render(<TUIChat {...createProps()} />);
const { lastFrame, stdin, rerender } = render(<TUIChat {...createProps()} />);
stdin.write("Test message");
const beforeEnter = lastFrame();
stdin.write("\r");
// Wait for the UI to update after pressing enter
await new Promise((resolve) => setTimeout(resolve, 50));
// Wait for the async message processing and UI updates
await new Promise((resolve) => setTimeout(resolve, 200));
// Force a rerender to ensure the UI has updated
rerender(<TUIChat {...createProps()} />);
// Give it a bit more time for the message to appear in the chat
await new Promise((resolve) => setTimeout(resolve, 100));
const afterEnter = lastFrame();