🔧 chore(vitest): mock the ResizeObserver API

used by ParallaxProvider
This commit is contained in:
2024-02-17 14:36:39 +01:00
parent 4c13289cd0
commit ad48b6e409
+12
View File
@@ -13,3 +13,15 @@ afterEach(() => {
vi.resetAllMocks() vi.resetAllMocks()
cleanup() cleanup()
}) })
/**
* Mocks the ResizeObserver API (used by ParallaxProvider)
*/
vi.stubGlobal(
'ResizeObserver',
vi.fn().mockImplementation(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
disconnect: vi.fn(),
}))
)