Use scrollTop for scrolling tests (#50660)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50660

Changelog: [internal]

This is just a simpler way to test for changes in scroll position.

Reviewed By: andrewdacenko

Differential Revision: D72860138

fbshipit-source-id: a92d430399255a278f5c3c72005a5288d28310ab
This commit is contained in:
Rubén Norte
2025-04-11 08:05:48 -07:00
committed by Facebook GitHub Bot
parent 277d39a216
commit d18abc8ec7
@@ -727,11 +727,15 @@ describe('Fantom', () => {
ReactNativeElement,
);
expect(scrollViewElement.scrollTop).toBe(0);
Fantom.scrollTo(scrollViewElement, {
x: 0,
y: 1,
});
expect(scrollViewElement.scrollTop).toBe(1);
expect(onScroll).toHaveBeenCalledTimes(1);
const viewElement = ensureInstance(maybeNode, ReactNativeElement);