Some checks failed
Chore App Build and Push Docker Images / build-and-push (push) Failing after 1m47s
21 lines
795 B
TypeScript
21 lines
795 B
TypeScript
import { vi } from 'vitest'
|
|
|
|
// jsdom does not implement scrollTo — stub it to suppress "Not implemented" warnings
|
|
window.scrollTo = vi.fn()
|
|
|
|
// jsdom does not support navigation — stub window.location to suppress
|
|
// "Not implemented: navigation to another Document" warnings
|
|
Object.defineProperty(window, 'location', {
|
|
value: { href: '', pathname: '/', assign: vi.fn(), replace: vi.fn(), reload: vi.fn() },
|
|
writable: true,
|
|
})
|
|
|
|
// Globally mock imageCache so component tests don't make real fetch calls
|
|
// and don't spam "response.blob is not a function" errors in jsdom.
|
|
vi.mock('@/common/imageCache', () => ({
|
|
getCachedImageUrl: vi.fn().mockResolvedValue(''),
|
|
getCachedImageBlob: vi.fn().mockResolvedValue(new Blob()),
|
|
revokeImageUrl: vi.fn(),
|
|
revokeAllImageUrls: vi.fn(),
|
|
}))
|