From c07ce79b31e668f200f0c38ac3efffd4c7e67d54 Mon Sep 17 00:00:00 2001 From: Stephannie Jimenez Date: Thu, 30 Nov 2023 17:11:40 -0500 Subject: [PATCH] fix: fix tests by mocking scrollIntoView function --- src/course-outline/CourseOutline.test.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/course-outline/CourseOutline.test.jsx b/src/course-outline/CourseOutline.test.jsx index 83c215f927..3aca2e8654 100644 --- a/src/course-outline/CourseOutline.test.jsx +++ b/src/course-outline/CourseOutline.test.jsx @@ -50,6 +50,8 @@ let store; const mockPathname = '/foo-bar'; const courseId = '123'; +window.HTMLElement.prototype.scrollIntoView = jest.fn(); + jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useLocation: () => ({