Skip to content

Commit ec7b64f

Browse files
edwinhuclaude
andcommitted
fix(test): wait for directory load before testing manual input mode
The FolderPicker manual input tests waited only for the pencil button to render, not for the async loadDirs to resolve. On Ubuntu CI the browsePath was still empty when clicked, causing toHaveValue to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7c24679 commit ec7b64f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

web/src/components/FolderPicker.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,9 @@ describe("FolderPicker", () => {
330330
// Validates the pencil icon opens a text input, and Enter selects the typed path
331331
const { onSelect } = setup();
332332

333+
// Wait for directories to load so browsePath is populated
333334
await waitFor(() => {
334-
expect(screen.getByLabelText("Type path manually")).toBeInTheDocument();
335+
expect(screen.getByText("src")).toBeInTheDocument();
335336
});
336337

337338
fireEvent.click(screen.getByLabelText("Type path manually"));
@@ -351,8 +352,9 @@ describe("FolderPicker", () => {
351352
// Validates Escape in manual input mode exits the input, not the dialog
352353
const { onClose } = setup();
353354

355+
// Wait for directories to load so the component is fully initialized
354356
await waitFor(() => {
355-
expect(screen.getByLabelText("Type path manually")).toBeInTheDocument();
357+
expect(screen.getByText("src")).toBeInTheDocument();
356358
});
357359

358360
fireEvent.click(screen.getByLabelText("Type path manually"));

0 commit comments

Comments
 (0)