fix(frontend): remove locale-dependent routing and migrate to centralized locale-aware router
- Replaced `next/navigation` with `@/lib/i18n/routing` across components, pages, and tests. - Removed redundant `locale` props from `ProjectWizard` and related pages. - Updated navigation to exclude explicit `locale` in paths. - Refactored tests to use mocks from `next-intl/navigation`.
This commit is contained in:
@@ -92,18 +92,8 @@ jest.mock('@/lib/hooks/useProjectEvents', () => ({
|
||||
useProjectEvents: jest.fn(() => mockUseProjectEventsResult),
|
||||
}));
|
||||
|
||||
// Mock next/navigation
|
||||
const mockPush = jest.fn();
|
||||
jest.mock('next/navigation', () => ({
|
||||
useRouter: () => ({
|
||||
push: mockPush,
|
||||
back: jest.fn(),
|
||||
forward: jest.fn(),
|
||||
refresh: jest.fn(),
|
||||
replace: jest.fn(),
|
||||
prefetch: jest.fn(),
|
||||
}),
|
||||
}));
|
||||
// Import mock from next-intl/navigation mock (used by @/lib/i18n/routing)
|
||||
import { mockPush } from 'next-intl/navigation';
|
||||
|
||||
describe('ProjectDashboard', () => {
|
||||
const projectId = 'test-project-123';
|
||||
|
||||
Reference in New Issue
Block a user