fix tests by waiting for indexing

This commit is contained in:
Nate 2025-07-19 16:47:39 -07:00
parent aad2306468
commit d91f99c854

View file

@ -10,10 +10,15 @@ describe("TUIChat - @ File Search Tests", () => {
// Type the @ character to trigger file search
stdin.write("@");
// Wait for file search to initialize and display files
await new Promise((resolve) => setTimeout(resolve, 100));
const indexingFrame = lastFrame()!;
expect(indexingFrame).toContain("Indexing files...");
const frame = lastFrame()!;
// Wait until indexing is complete
let frame;
do {
await new Promise((resolve) => setTimeout(resolve, 100));
frame = lastFrame()!;
} while (frame.includes("Indexing files..."));
// Should show file search UI with files
expect(frame).toContain("@");