import { act, fireEvent, render, screen } from '@testing-library/react'; import * as AnimationControllerModule from './animation/AnimationContext'; import { ESCAPE } from './keyCodes'; import OverlayPanel from './OverlayPanel'; import * as useReducedMotionHook from './useReducedMotion'; jest.mock('./useReducedMotion'); describe('OverlayPanel', () => { let useAnimationMock: any; const useReducedMotionMock = jest.spyOn(useReducedMotionHook, 'default'); beforeEach(() => { useAnimationMock = jest.spyOn(AnimationControllerModule, 'useAnimation'); useReducedMotionMock.mockReturnValue(true); }); afterEach(() => { jest.restoreAllMocks(); }); it('should render all props with nodes', () => { const { container } = render( } heading="OverlayPanel title" onDismiss={jest.fn()} size="sm" subHeading={