Skip to content

Commit

Permalink
test(menu): improves test by removing unecessary id
Browse files Browse the repository at this point in the history
improves test by using role instead of id
  • Loading branch information
santanasara committed Apr 30, 2024
1 parent d001939 commit 5d33faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions components/Menu/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const Menu = (props) => {
};
return (
<MaterialMenu
id="menu"
data-testid="menu"
theme={materialThemeOverride}
aria-labelledby="button"
anchorReference="anchorEl"
Expand Down
4 changes: 2 additions & 2 deletions components/Menu/Menu.unit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ describe('<Menu />', () => {
});

it('does not render with anchorEl when open is false', () => {
const { queryByTestId } = renderMenu({
const { queryByRole } = renderMenu({
open: false,
items: mockItems,
anchorEl: mockAnchorEl,
onClose: mockHandleClose,
});
const menu = queryByTestId('menu');
const menu = queryByRole('presentation');
expect(menu).toBeNull();
});

Expand Down

0 comments on commit 5d33faf

Please sign in to comment.