PromucFlow_constructor/app/client/packages/design-system/ads-old/jest.setup.ts

18 lines
463 B
TypeScript
Raw Normal View History

2024-07-29 13:23:26 +00:00
import "@testing-library/jest-dom";
window.scrollTo = jest.fn();
Element.prototype.scrollIntoView = jest.fn();
Element.prototype.scrollBy = jest.fn();
const mockObserveFn = () => {
return {
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
};
};
window.IntersectionObserver = jest.fn().mockImplementation(mockObserveFn);
window.ResizeObserver = jest.fn().mockImplementation(mockObserveFn);
Element.prototype.scrollTo = () => {};