Update ReactActivityDelegateTest to compile and run with Buck (#37199)

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

This test `ReactActivityDelegateTest` is written in Kotlin and is not currently
picked up by BUCK. As we look into having more and more tests written in Kotlin,
I'm updating one Kotlin test to be executed correctly within Buck.

Changelog:
[Internal] [Changed] - Update ReactActivityDelegateTest to compile and run with Buck

Reviewed By: philIip, mdvacca

Differential Revision: D45497636

fbshipit-source-id: 7e13902c4f765974c1ff490b657846fb062eb74e
This commit is contained in:
Nicola Corti
2023-05-03 03:27:17 -07:00
committed by Facebook GitHub Bot
parent 0cec0412e5
commit ceebab44b4
@@ -7,6 +7,7 @@
package com.facebook.react
import android.app.Activity
import android.os.Bundle
import org.junit.Assert.*
import org.junit.Test
@@ -16,10 +17,12 @@ import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
class ReactActivityDelegateTest {
val nullDelegate: Activity? = null
@Test
fun delegateWithFabricEnabled_populatesInitialPropsCorrectly() {
val delegate =
object : ReactActivityDelegate(null, "test-delegate") {
object : ReactActivityDelegate(nullDelegate, "test-delegate") {
override fun isFabricEnabled() = true
public val inspectLaunchOptions: Bundle?
get() = composeLaunchOptions()
@@ -33,7 +36,7 @@ class ReactActivityDelegateTest {
@Test
fun delegateWithoutFabricEnabled_hasNullInitialProperties() {
val delegate =
object : ReactActivityDelegate(null, "test-delegate") {
object : ReactActivityDelegate(nullDelegate, "test-delegate") {
override fun isFabricEnabled() = false
public val inspectLaunchOptions: Bundle?
get() = composeLaunchOptions()
@@ -45,7 +48,7 @@ class ReactActivityDelegateTest {
@Test
fun delegateWithFabricEnabled_composesInitialPropertiesCorrectly() {
val delegate =
object : ReactActivityDelegate(null, "test-delegate") {
object : ReactActivityDelegate(nullDelegate, "test-delegate") {
override fun isFabricEnabled() = true
override fun getLaunchOptions(): Bundle =
Bundle().apply { putString("test-property", "test-value") }