Skip to content

Commit 300198b

Browse files
committed
fix: use role-based queries to avoid matching modal title
1 parent e152270 commit 300198b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/browser/components/ProjectCreateModal.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export const FullFlowWithDirectoryPicker: Story = {
384384
});
385385

386386
// Click Add Project to complete the flow
387-
await userEvent.click(canvas.getByText("Add Project"));
387+
await userEvent.click(canvas.getByRole("button", { name: "Add Project" }));
388388

389389
// Modal should close after successful creation
390390
await waitFor(() => {
@@ -424,7 +424,7 @@ export const CancelDirectoryPicker: Story = {
424424
});
425425

426426
// Main modal should still be visible
427-
expect(canvas.getByText("Add Project")).toBeInTheDocument();
427+
expect(canvas.getByRole("button", { name: "Add Project" })).toBeInTheDocument();
428428
},
429429
};
430430

@@ -470,7 +470,7 @@ export const ValidationError: Story = {
470470
await userEvent.type(input, "/invalid/path");
471471

472472
// Click Add Project
473-
await userEvent.click(canvas.getByText("Add Project"));
473+
await userEvent.click(canvas.getByRole("button", { name: "Add Project" }));
474474

475475
// Wait for error message
476476
await waitFor(() => {

0 commit comments

Comments
 (0)