test(frontend): update test imports to lib/ path, configure vitest.config.ts and vitest.setup.ts

This commit is contained in:
parsa aghaei committed 2026-08-03 10:22:16 +03:30
1 parent 7e072793eb
commit cf5ab2030d
9 files changed
+1992 -37

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import '@testing-library/jest-dom';
import { vi } from 'vitest';
class MockIntersectionObserver {
observe = vi.fn();
disconnect = vi.fn();
unobserve = vi.fn();
}
Object.defineProperty(window, 'IntersectionObserver', {
writable: true,
configurable: true,
value: MockIntersectionObserver,
});
vi.mock('next/navigation', () => ({
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
}),
usePathname: () => '/',
useSearchParams: () => new URLSearchParams(),
}));