Skip to content

Commit e567c61

Browse files
cursoragentJonasBa
andcommitted
Fix test: use menuitemradio role instead of menuitem
DropdownMenu renders items with menuitemradio role, not menuitem. Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
1 parent 1a93d96 commit e567c61

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

static/app/views/navigation/primary/noOrganizationDropdown.spec.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('NoOrganizationDropdown', () => {
2626
await userEvent.click(screen.getByRole('button', {name: 'Organization menu'}));
2727

2828
expect(
29-
await screen.findByRole('menuitem', {name: 'Create a new organization'})
29+
await screen.findByRole('menuitemradio', {name: 'Create a new organization'})
3030
).toBeInTheDocument();
3131
});
3232

@@ -42,7 +42,7 @@ describe('NoOrganizationDropdown', () => {
4242
await userEvent.click(screen.getByRole('button', {name: 'Organization menu'}));
4343

4444
expect(
45-
screen.queryByRole('menuitem', {name: 'Create a new organization'})
45+
screen.queryByRole('menuitemradio', {name: 'Create a new organization'})
4646
).not.toBeInTheDocument();
4747
});
4848

@@ -62,7 +62,9 @@ describe('NoOrganizationDropdown', () => {
6262

6363
await userEvent.click(screen.getByRole('button', {name: 'Organization menu'}));
6464

65-
const link = await screen.findByRole('menuitem', {name: 'Create a new organization'});
65+
const link = await screen.findByRole('menuitemradio', {
66+
name: 'Create a new organization',
67+
});
6668
expect(link).toHaveAttribute('href', 'https://sentry.io/organizations/new/');
6769
});
6870

@@ -77,7 +79,9 @@ describe('NoOrganizationDropdown', () => {
7779

7880
await userEvent.click(screen.getByRole('button', {name: 'Organization menu'}));
7981

80-
const link = await screen.findByRole('menuitem', {name: 'Create a new organization'});
82+
const link = await screen.findByRole('menuitemradio', {
83+
name: 'Create a new organization',
84+
});
8185
expect(link).toHaveAttribute('href', '/organizations/new/');
8286
});
8387
});

0 commit comments

Comments
 (0)