Add Jest scrollIntoView mock

This commit is contained in:
Vitaly Rtishchev
2024-03-15 15:40:39 +04:00
parent df6fcffe80
commit 75d75126d4

View File

@ -2,6 +2,7 @@ require('@testing-library/jest-dom');
const { getComputedStyle } = window; const { getComputedStyle } = window;
window.getComputedStyle = (elt) => getComputedStyle(elt); window.getComputedStyle = (elt) => getComputedStyle(elt);
window.HTMLElement.prototype.scrollIntoView = () => {};
Object.defineProperty(window, 'matchMedia', { Object.defineProperty(window, 'matchMedia', {
writable: true, writable: true,