From e014ded82a630bd91b15be4307125f5580119f4d Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 13:50:25 -0800 Subject: Analyze page size and fix frontend tests --- frontend/src/setupTests.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'frontend/src/setupTests.ts') diff --git a/frontend/src/setupTests.ts b/frontend/src/setupTests.ts index 7b0828b..2afa12e 100644 --- a/frontend/src/setupTests.ts +++ b/frontend/src/setupTests.ts @@ -1 +1,40 @@ import '@testing-library/jest-dom'; + +// Mock IntersectionObserver +class IntersectionObserver { + readonly root: Element | null = null; + readonly rootMargin: string = ''; + readonly thresholds: ReadonlyArray = []; + + constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit) { + // nothing + } + + observe(target: Element): void { + // nothing + } + + unobserve(target: Element): void { + // nothing + } + + disconnect(): void { + // nothing + } + + takeRecords(): IntersectionObserverEntry[] { + return []; + } +} + +Object.defineProperty(window, 'IntersectionObserver', { + writable: true, + configurable: true, + value: IntersectionObserver, +}); + +Object.defineProperty(global, 'IntersectionObserver', { + writable: true, + configurable: true, + value: IntersectionObserver, +}); -- cgit v1.2.3