How to fireEvent.scroll on a element inside container with react-testing-library?

Have you tried adding EventListener to your scroll container? I’m just not sure with that library you may have just used, but I’m pretty sure, in normal situations, calling scroll fireEvent without listener won’t execute anything. Before your fireEvent, insert something like this:

scrollContainer.addEventListener('scroll', () => { /* some callback */ });

and change your fireEvent to:

fireEvent.scroll(scrollContainer, { target: { scrollY: 100 } });

Leave a Comment

techhipbettruvabetnorabahisbahis forumuedueduedueduedusedueduseduedusedu