Skip to content

Commit

Permalink
small edit adding back test router mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Clue355 committed Oct 7, 2024
1 parent 930b5ca commit 1013bfc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/AdminNav/AdminNav.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ import { AuthContextProvider } from '@/context/AuthContextProvider';
import { render, screen } from '@testing-library/react';
import React from 'react';

const mockPush = jest.fn();
const mockUsePathname = jest.fn();

jest.mock('next/navigation', () => ({
useRouter() {
return {
push: mockPush,
};
},
usePathname() {
return mockUsePathname();
},
}));

describe('AdminNav Component', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down

0 comments on commit 1013bfc

Please sign in to comment.