Skip to content

Commit 0603b23

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Bridgeless-context ReactScrollViewHelperFlingAnimatorTest (#59277)
Summary: Pull Request resolved: #59277 Migrate `ReactScrollViewHelperFlingAnimatorTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Stub the feature flags before context creation, since the bridgeless context reads them during init. Changelog: [Internal] Reviewed By: javache Differential Revision: D126574358 fbshipit-source-id: bfed4619667e1e997e45d8fe2101d412d2b31819
1 parent 28ed174 commit 0603b23

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/scroll/ReactScrollViewHelperFlingAnimatorTest.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import android.view.View
1313
import android.view.ViewGroup
1414
import com.facebook.react.bridge.ReactContext
1515
import com.facebook.react.bridge.ReactTestHelper
16+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
1617
import com.facebook.react.uimanager.StateWrapper
1718
import com.facebook.react.uimanager.UIManagerHelper
1819
import com.facebook.react.uimanager.events.Event
@@ -63,10 +64,12 @@ class ReactScrollViewHelperFlingAnimatorTest {
6364
@Before
6465
@Suppress("UNCHECKED_CAST")
6566
fun setUp() {
67+
ReactNativeFeatureFlagsForTests.setUp()
6668
mockChild = mock()
6769
mockAnimator = ValueAnimator()
6870
mockEventDispatcher = mock()
69-
mockContext = ReactTestHelper.createCatalystContextForTest()
71+
mockContext =
72+
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
7073

7174
mockScrollView = mock<MockScrollView>()
7275

0 commit comments

Comments
 (0)