Skip to content

Commit

Permalink
Add one case to selected item tests (not Next.js specific though)
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira committed Feb 4, 2025
1 parent 49533ed commit c77a462
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ describe('DashboardLayout', () => {
'Mui-selected',
);

rerender(<AppWithPathname pathname="/orders?query=test" />);

expect(within(desktopNavigation).getByRole('link', { name: 'Dashboard' })).not.toHaveClass(
'Mui-selected',
);
expect(within(desktopNavigation).getByRole('link', { name: 'Orders' })).toHaveClass(
'Mui-selected',
);

rerender(<AppWithPathname pathname="/dynamic" />);
expect(within(desktopNavigation).getByRole('link', { name: 'Dynamic' })).not.toHaveClass(
'Mui-selected',
Expand Down

0 comments on commit c77a462

Please sign in to comment.