diff --git a/src/test/webapp/unit/module/primary/landscape/LandscapeComponent.spec.ts b/src/test/webapp/unit/module/primary/landscape/LandscapeComponent.spec.ts index 8b3ca88770b..d9c91f66d69 100644 --- a/src/test/webapp/unit/module/primary/landscape/LandscapeComponent.spec.ts +++ b/src/test/webapp/unit/module/primary/landscape/LandscapeComponent.spec.ts @@ -1353,9 +1353,10 @@ describe('Landscape', () => { } const setupScrollTest = (wrapper: VueWrapper, { moduleRect }: { moduleRect: ModuleRect }) => { + const mockToJSON = vi.fn().mockImplementation(() => JSON.stringify(moduleRect)); const mockModuleRect = vi.spyOn(Element.prototype, 'getBoundingClientRect').mockImplementation(() => ({ ...moduleRect, - toJSON: () => JSON.stringify(moduleRect), + toJSON: mockToJSON, })); const mockContainerRect = vi.fn().mockReturnValue({