Skip to content

Commit

Permalink
Fix broken unableToAddHandledRootView (#45101)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #45101

This test broke after I merged
#34785
yesterday.

Just fixing it in a similar way as the test above.

Changelog:
[Internal] [Changed] - Fix broken unableToAddHandledRootView

Reviewed By: rubennorte, blakef

Differential Revision: D58864166

fbshipit-source-id: 4f48dbfd5238a2811564ce02199af7fc284d39b4
  • Loading branch information
cortinico authored and facebook-github-bot committed Jun 21, 2024
1 parent 15909fa commit e7d1708
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import com.facebook.react.bridge.ReactTestHelper.createMockCatalystInstance
import com.facebook.react.fabric.mounting.MountingManager
import com.facebook.react.fabric.mounting.MountingManager.MountItemExecutor
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
import com.facebook.react.uimanager.IllegalViewOperationException
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManager
import com.facebook.react.uimanager.ViewManagerRegistry
Expand Down Expand Up @@ -68,11 +67,13 @@ class MountingManagerTest {
mountingManager.startSurface(rootReactTag, themedReactContext, reactRootView)
}

@Test(expected = IllegalViewOperationException::class)
fun unableToAddHandledRootView() {
val reactRootView = ReactRootView(themedReactContext)
reactRootView.id = 1234567
val rootReactTag = nextRootTag++

// As above this is also a SoftException.
// See https://github.com/facebook/react-native/pull/34785 for more context.
mountingManager.startSurface(rootReactTag, themedReactContext, reactRootView)
}
}

0 comments on commit e7d1708

Please sign in to comment.