feat: T04 fixes - i18n, auth tests, contact/vehicle test cleanup, status updates

This commit is contained in:
2026-07-14 20:16:15 +02:00
parent 2cf433a01c
commit b128ea6b39
16 changed files with 379 additions and 1004 deletions
+14 -4
View File
@@ -1,15 +1,25 @@
import '@testing-library/jest-dom';
import { vi } from 'vitest';
// Mock next/navigation globally
// Mock localStorage
const localStorageMock = (() => {
let store: Record<string, string> = {};
return {
getItem: (key: string) => store[key] || null,
setItem: (key: string, value: string) => { store[key] = value; },
removeItem: (key: string) => { delete store[key]; },
clear: () => { store = {}; },
};
})();
Object.defineProperty(window, 'localStorage', { value: localStorageMock });
// Mock next/navigation
vi.mock('next/navigation', () => ({
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
back: vi.fn(),
refresh: vi.fn(),
}),
redirect: vi.fn(),
usePathname: () => '/login',
usePathname: () => '/',
useSearchParams: () => new URLSearchParams(),
}));