diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-13 13:50:25 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-13 13:50:25 -0800 |
| commit | e014ded82a630bd91b15be4307125f5580119f4d (patch) | |
| tree | 416712eef67ba5cac1c3e55780b80ab04c9aec47 /frontend/src/setupTests.ts | |
| parent | e7f0e40b3563a56a06f5bedd3efd40b750e74521 (diff) | |
| download | neko-e014ded82a630bd91b15be4307125f5580119f4d.tar.gz neko-e014ded82a630bd91b15be4307125f5580119f4d.tar.bz2 neko-e014ded82a630bd91b15be4307125f5580119f4d.zip | |
Analyze page size and fix frontend tests
Diffstat (limited to 'frontend/src/setupTests.ts')
| -rw-r--r-- | frontend/src/setupTests.ts | 39 |
1 files changed, 39 insertions, 0 deletions
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<number> = []; + + 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, +}); |
