diff --git a/ui/src/Components/Grid/AlertGrid/index.test.tsx b/ui/src/Components/Grid/AlertGrid/index.test.tsx index 4548c9c3a..211c63637 100644 --- a/ui/src/Components/Grid/AlertGrid/index.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/index.test.tsx @@ -35,6 +35,11 @@ beforeEach(() => { window.matchMedia = mockMatchMedia({}); + window.requestAnimationFrame = (cb: FrameRequestCallback) => { + cb(0); + return 0; + }; + jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); Object.defineProperty(document.body, "clientWidth", { diff --git a/ui/src/Components/NavBar/index.test.tsx b/ui/src/Components/NavBar/index.test.tsx index a749fefd4..b1fb8ded9 100644 --- a/ui/src/Components/NavBar/index.test.tsx +++ b/ui/src/Components/NavBar/index.test.tsx @@ -35,6 +35,11 @@ beforeEach(() => { // fix startsAt & endsAt dates so they don't change between tests silenceFormStore.data.setStart(new Date(Date.UTC(2018, 1, 30, 10, 25, 50))); silenceFormStore.data.setEnd(new Date(Date.UTC(2018, 1, 30, 11, 25, 50))); + + jest.spyOn(window, "requestAnimationFrame").mockImplementation((cb) => { + cb(0); + return 0; + }); }); afterEach(() => {