From aeb5b02931f74abfd14ab719bd4b1ac53b093c59 Mon Sep 17 00:00:00 2001 From: Linus Pahl <46300478+linuspahl@users.noreply.github.com> Date: Thu, 16 May 2024 14:04:30 +0200 Subject: [PATCH] Extend mock for `IntersectionObserver` with `disconnect` method. (#19366) --- .../lib/setup-files/mock-IntersectionObserver.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/graylog2-web-interface/packages/jest-preset-graylog/lib/setup-files/mock-IntersectionObserver.js b/graylog2-web-interface/packages/jest-preset-graylog/lib/setup-files/mock-IntersectionObserver.js index ff20188e45e2..38a40a9ebcfc 100644 --- a/graylog2-web-interface/packages/jest-preset-graylog/lib/setup-files/mock-IntersectionObserver.js +++ b/graylog2-web-interface/packages/jest-preset-graylog/lib/setup-files/mock-IntersectionObserver.js @@ -14,10 +14,8 @@ * along with this program. If not, see * . */ -const observe = jest.fn(); -const unobserve = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ - observe, - unobserve, + observe: jest.fn(), + unobserve: jest.fn(), + disconnect: jest.fn(), }));