Skip to content

Commit 29de071

Browse files
author
Fabian Stoehr
committed
chore: fix tests
1 parent 07fb693 commit 29de071

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

__tests__/src/components/WindowThumbnailSettings.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ describe('WindowThumbnailSettings', () => {
2020
it('renders all elements correctly', () => {
2121
createWrapper();
2222
expect(screen.getByRole('presentation', { selector: 'li' })).toBeInTheDocument();
23-
expect(screen.getByRole('menuitem', { name: /Off/ })).toBeInTheDocument();
24-
expect(screen.getByRole('menuitem', { name: /Bottom/ })).toBeInTheDocument();
25-
expect(screen.getByRole('menuitem', { name: /Right/ })).toBeInTheDocument();
23+
expect(screen.getByRole('menuitemradio', { name: /Off/ })).toBeInTheDocument();
24+
expect(screen.getByRole('menuitemradio', { name: /Bottom/ })).toBeInTheDocument();
25+
expect(screen.getByRole('menuitemradio', { name: /Right/ })).toBeInTheDocument();
2626
});
2727
it('for far-bottom it should set the correct label active (by setting the secondary color)', () => {
2828
createWrapper({ thumbnailNavigationPosition: 'far-bottom' });
29-
expect(screen.getByRole('menuitem', { name: /Bottom/ }).querySelector('svg')).toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
30-
expect(screen.getByRole('menuitem', { name: /Right/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
31-
expect(screen.getByRole('menuitem', { name: /Off/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
29+
expect(screen.getByRole('menuitemradio', { name: /Bottom/ }).querySelector('svg')).toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
30+
expect(screen.getByRole('menuitemradio', { name: /Right/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
31+
expect(screen.getByRole('menuitemradio', { name: /Off/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
3232
});
3333
it('for far-right it should set the correct label active (by setting the secondary color)', () => {
3434
createWrapper({ thumbnailNavigationPosition: 'far-right' });
35-
expect(screen.getByRole('menuitem', { name: /Right/ }).querySelector('svg')).toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
36-
expect(screen.getByRole('menuitem', { name: /Off/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
37-
expect(screen.getByRole('menuitem', { name: /Bottom/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
35+
expect(screen.getByRole('menuitemradio', { name: /Right/ }).querySelector('svg')).toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
36+
expect(screen.getByRole('menuitemradio', { name: /Off/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
37+
expect(screen.getByRole('menuitemradio', { name: /Bottom/ }).querySelector('svg')).not.toHaveClass('MuiSvgIcon-colorSecondary'); // eslint-disable-line testing-library/no-node-access
3838
});
3939

4040
it('updates state when the thumbnail config selection changes', async () => {
4141
const setWindowThumbnailPosition = vi.fn();
4242
const user = userEvent.setup();
4343
createWrapper({ setWindowThumbnailPosition });
44-
const menuItems = screen.queryAllByRole('menuitem');
44+
const menuItems = screen.queryAllByRole('menuitemradio');
4545
expect(menuItems.length).toBe(3);
4646
expect(menuItems[0]).toBeInTheDocument();
4747
expect(menuItems[1]).toBeInTheDocument();
@@ -57,6 +57,6 @@ describe('WindowThumbnailSettings', () => {
5757

5858
it('when rtl flips an icon', () => {
5959
createWrapper({ direction: 'rtl' });
60-
expect(screen.getByRole('menuitem', { name: /Right/ }).querySelector('svg')).toHaveStyle('transform: rotate(180deg);'); // eslint-disable-line testing-library/no-node-access
60+
expect(screen.getByRole('menuitemradio', { name: /Right/ }).querySelector('svg')).toHaveStyle('transform: rotate(180deg);'); // eslint-disable-line testing-library/no-node-access
6161
});
6262
});

__tests__/src/components/WindowTopMenuButton.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('WindowTopMenuButton', () => {
3333
expect(screen.getByRole('menu')).toBeInTheDocument();
3434

3535
// click something else to close the menu (the windowMenu button is hidden at this point)
36-
await user.click(screen.getAllByRole('menuitem')[0]);
36+
await user.click(screen.getAllByRole('menuitemradio')[0]);
3737
expect(screen.queryByRole('menu')).not.toBeInTheDocument();
3838
});
3939

0 commit comments

Comments
 (0)