Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.mock
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.shadow.api.Shadow
Expand Down Expand Up @@ -76,7 +77,8 @@ class FabricUIManagerPullModelTest {
fun setup() {
ReactNativeFeatureFlagsForTests.setUp()
overrideFeatureFlags()
reactContext = ReactTestHelper.createCatalystContextForTest()
reactContext =
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
underTest =
FabricUIManager(
reactContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
Expand All @@ -54,7 +55,8 @@ class MountingManagerAnimatedPropsTest {
@Before
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
val reactContext = ReactTestHelper.createCatalystContextForTest()
val reactContext =
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1)
mountingManager =
MountingManager(ViewManagerRegistry(listOf<ViewManager<*, *>>(ReactViewManager())), {})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config

/**
Expand Down Expand Up @@ -65,7 +66,8 @@ class SurfaceMountingManagerSynchronousMountPropsTest {
@Before
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
val reactContext = ReactTestHelper.createCatalystContextForTest()
val reactContext =
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1)
mountingManager =
MountingManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManager
import com.facebook.react.uimanager.ViewManagerRegistry
import com.facebook.react.views.view.ReactViewManager
import com.facebook.testutils.shadows.ShadowSoLoader
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config

/**
* Tests for [SurfaceMountingManager] view lifecycle around preallocateView, deleteView, and
Expand All @@ -42,6 +45,7 @@ import org.robolectric.RobolectricTestRunner
* See T223288217.
*/
@RunWith(RobolectricTestRunner::class)
@Config(shadows = [ShadowSoLoader::class])
class SurfaceMountingManagerTest {
private lateinit var mountingManager: MountingManager
private lateinit var themedReactContext: ThemedReactContext
Expand All @@ -50,7 +54,8 @@ class SurfaceMountingManagerTest {
@Before
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
val reactContext = ReactTestHelper.createCatalystContextForTest()
val reactContext =
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1)
mountingManager =
MountingManager(
Expand Down
Loading