Skip to content

Commit d12a2cb

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Bridgeless-context ReactEditTextOutlineTest (#59496)
Summary: Pull Request resolved: #59496 Migrate `ReactEditTextOutlineTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Add the `ShadowSoLoader` Robolectric shadow the bridgeless helper needs. Changelog: [Internal] Reviewed By: javache Differential Revision: D127469707 fbshipit-source-id: 34eb48fa8ff2702504b0863fe106ec018f161bf1
1 parent 53e96f0 commit d12a2cb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactEditTextOutlineTest.kt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ import android.view.ViewGroup
2525
import android.view.ViewOutlineProvider
2626
import androidx.annotation.RequiresApi
2727
import androidx.core.graphics.drawable.toDrawable
28-
import com.facebook.react.bridge.ReactTestHelper.createCatalystContextForTest
28+
import com.facebook.react.bridge.ReactTestHelper.createTestReactApplicationContext
2929
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
3030
import com.facebook.react.uimanager.DisplayMetricsHolder
3131
import com.facebook.react.uimanager.ThemedReactContext
32+
import com.facebook.testutils.shadows.ShadowSoLoader
3233
import org.assertj.core.api.Assertions.assertThat
3334
import org.junit.Before
3435
import org.junit.Test
@@ -37,8 +38,10 @@ import org.robolectric.Robolectric
3738
import org.robolectric.RobolectricTestRunner
3839
import org.robolectric.RuntimeEnvironment
3940
import org.robolectric.Shadows.shadowOf
41+
import org.robolectric.annotation.Config
4042

4143
@RunWith(RobolectricTestRunner::class)
44+
@Config(shadows = [ShadowSoLoader::class])
4245
@RequiresApi(Build.VERSION_CODES.N)
4346
class ReactEditTextOutlineTest {
4447

@@ -47,7 +50,7 @@ class ReactEditTextOutlineTest {
4750
@Before
4851
fun setup() {
4952
ReactNativeFeatureFlagsForTests.setUp()
50-
val context = createCatalystContextForTest()
53+
val context = createTestReactApplicationContext(RuntimeEnvironment.getApplication())
5154
DisplayMetricsHolder.setScreenDisplayMetrics(DisplayMetrics())
5255
view =
5356
ReactTextInputManager().createViewInstance(ThemedReactContext(context, context, null, -1))

0 commit comments

Comments
 (0)