Skip to content

Commit 5fb24de

Browse files
committed
fix: click the correct Cancel button in directory picker test
1 parent 300198b commit 5fb24de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/browser/components/ProjectCreateModal.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,9 @@ export const CancelDirectoryPicker: Story = {
415415
expect(canvas.getByText("Select Project Directory")).toBeInTheDocument();
416416
});
417417

418-
// Click Cancel
419-
await userEvent.click(canvas.getByText("Cancel"));
418+
// Click Cancel in the directory picker (the second/last Cancel button visible)
419+
const cancelButtons = canvas.getAllByRole("button", { name: "Cancel" });
420+
await userEvent.click(cancelButtons[cancelButtons.length - 1]);
420421

421422
// DirectoryPickerModal should close but main modal stays open
422423
await waitFor(() => {

0 commit comments

Comments
 (0)