diff --git a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatNode.kt b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatNode.kt index 29a13d2fa4..f42b7da7cc 100644 --- a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatNode.kt +++ b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatNode.kt @@ -46,7 +46,7 @@ class StartChatNode @AssistedInject constructor( override fun View(modifier: Modifier) { val state = presenter.present() val activity = requireNotNull(LocalActivity.current) - CreateRoomRootView( + StartChatView( state = state, modifier = modifier, onCloseClick = this::navigateUp, diff --git a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatView.kt b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatView.kt index 53ed7782ff..ebde080f75 100644 --- a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatView.kt +++ b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/root/StartChatView.kt @@ -48,7 +48,7 @@ import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.persistentListOf @Composable -fun CreateRoomRootView( +fun StartChatView( state: StartChatState, onCloseClick: () -> Unit, onNewRoomClick: () -> Unit, @@ -239,9 +239,9 @@ private fun CreateRoomActionButton( @PreviewsDayNight @Composable -internal fun CreateRoomRootViewPreview(@PreviewParameter(StartChatStateProvider::class) state: StartChatState) = +internal fun StartChatViewPreview(@PreviewParameter(StartChatStateProvider::class) state: StartChatState) = ElementPreview { - CreateRoomRootView( + StartChatView( state = state, onCloseClick = {}, onNewRoomClick = {}, diff --git a/features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/CreateBaseRoomRootViewTest.kt b/features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/StartChatViewTest.kt similarity index 94% rename from features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/CreateBaseRoomRootViewTest.kt rename to features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/StartChatViewTest.kt index 81f764dd59..d488f251e0 100644 --- a/features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/CreateBaseRoomRootViewTest.kt +++ b/features/startchat/impl/src/test/kotlin/io/element/android/features/startchat/impl/root/StartChatViewTest.kt @@ -34,7 +34,7 @@ import org.robolectric.annotation.Config import kotlin.collections.get @RunWith(AndroidJUnit4::class) -class CreateBaseRoomRootViewTest { +class StartChatViewTest { @get:Rule val rule = createAndroidComposeRule() @@ -42,7 +42,7 @@ class CreateBaseRoomRootViewTest { fun `clicking on back invokes the expected callback`() { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( eventSink = eventsRecorder, ), @@ -56,7 +56,7 @@ class CreateBaseRoomRootViewTest { fun `clicking on New room invokes the expected callback`() { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( eventSink = eventsRecorder, ), @@ -71,7 +71,7 @@ class CreateBaseRoomRootViewTest { fun `clicking on Invite people invokes the expected callback`() { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( applicationName = "test", eventSink = eventsRecorder, @@ -90,7 +90,7 @@ class CreateBaseRoomRootViewTest { val firstRoom = recentDirectRoomList[0] val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnceWithParam(firstRoom.roomId) { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( userListState = aUserListState( recentDirectRooms = recentDirectRoomList @@ -108,7 +108,7 @@ class CreateBaseRoomRootViewTest { fun `clicking on Join room by address invokes the expected callback`() { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( eventSink = eventsRecorder, ), @@ -122,7 +122,7 @@ class CreateBaseRoomRootViewTest { fun `clicking on room directory invokes the expected callback`() { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { - rule.setCreateRoomRootView( + rule.setStartChatView( aCreateRoomRootState( eventSink = eventsRecorder, isRoomDirectorySearchEnabled = true @@ -134,7 +134,7 @@ class CreateBaseRoomRootViewTest { } } -private fun AndroidComposeTestRule.setCreateRoomRootView( +private fun AndroidComposeTestRule.setStartChatView( state: StartChatState, onCloseClick: () -> Unit = EnsureNeverCalled(), onNewRoomClick: () -> Unit = EnsureNeverCalled(), @@ -144,7 +144,7 @@ private fun AndroidComposeTestRule.setCreat onRoomDirectorySearchClick: () -> Unit = EnsureNeverCalled(), ) { setContent { - CreateRoomRootView( + StartChatView( state = state, onCloseClick = onCloseClick, onNewRoomClick = onNewRoomClick,