Files
pepperplus-ui/test/pages/visProgPage/visualProgrammingUI/components/ScrollIntoView.test.tsx
JobvAlewijk d4393e7635 test: scroll
ref: N25B-292
2025-12-02 11:36:10 +01:00

15 lines
437 B
TypeScript

import { render } from '@testing-library/react';
import { act } from '@testing-library/react';
import ScrollIntoView from '../../../../../src/components/ScrollIntoView';
test('scrolls the element into view on render', () => {
const scrollMock = jest.fn();
HTMLElement.prototype.scrollIntoView = scrollMock;
act(() => {
render(<ScrollIntoView />);
});
expect(scrollMock).toHaveBeenCalledWith({ behavior: 'smooth' });
});