build fix

This commit is contained in:
2026-01-15 16:19:14 +02:00
commit ea4990457e
1493 changed files with 146633 additions and 0 deletions

50
jest.setup.js Normal file
View File

@@ -0,0 +1,50 @@
// Learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'
// Mock Next.js router
jest.mock('next/navigation', () => ({
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
prefetch: jest.fn(),
back: jest.fn(),
}),
usePathname: () => '/dashboard',
useSearchParams: () => new URLSearchParams(),
}))
// Mock window.location
if (typeof window !== 'undefined') {
delete window.location;
window.location = {
origin: 'http://localhost:3000',
href: 'http://localhost:3000/dashboard',
reload: jest.fn(),
};
}
// Mock localStorage
const localStorageMock = {
getItem: jest.fn(),
setItem: jest.fn(),
removeItem: jest.fn(),
clear: jest.fn(),
}
global.localStorage = localStorageMock
// Mock sessionStorage
const sessionStorageMock = {
getItem: jest.fn(),
setItem: jest.fn(),
removeItem: jest.fn(),
clear: jest.fn(),
}
global.sessionStorage = sessionStorageMock
// Suppress console errors in tests unless needed
global.console = {
...console,
error: jest.fn(),
warn: jest.fn(),
}