Rename View to follow naming convention and file name
This commit is contained in:
@@ -46,7 +46,7 @@ class StartChatNode @AssistedInject constructor(
|
|||||||
override fun View(modifier: Modifier) {
|
override fun View(modifier: Modifier) {
|
||||||
val state = presenter.present()
|
val state = presenter.present()
|
||||||
val activity = requireNotNull(LocalActivity.current)
|
val activity = requireNotNull(LocalActivity.current)
|
||||||
CreateRoomRootView(
|
StartChatView(
|
||||||
state = state,
|
state = state,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
onCloseClick = this::navigateUp,
|
onCloseClick = this::navigateUp,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
|||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CreateRoomRootView(
|
fun StartChatView(
|
||||||
state: StartChatState,
|
state: StartChatState,
|
||||||
onCloseClick: () -> Unit,
|
onCloseClick: () -> Unit,
|
||||||
onNewRoomClick: () -> Unit,
|
onNewRoomClick: () -> Unit,
|
||||||
@@ -239,9 +239,9 @@ private fun CreateRoomActionButton(
|
|||||||
|
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun CreateRoomRootViewPreview(@PreviewParameter(StartChatStateProvider::class) state: StartChatState) =
|
internal fun StartChatViewPreview(@PreviewParameter(StartChatStateProvider::class) state: StartChatState) =
|
||||||
ElementPreview {
|
ElementPreview {
|
||||||
CreateRoomRootView(
|
StartChatView(
|
||||||
state = state,
|
state = state,
|
||||||
onCloseClick = {},
|
onCloseClick = {},
|
||||||
onNewRoomClick = {},
|
onNewRoomClick = {},
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import org.robolectric.annotation.Config
|
|||||||
import kotlin.collections.get
|
import kotlin.collections.get
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
class CreateBaseRoomRootViewTest {
|
class StartChatViewTest {
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val rule = createAndroidComposeRule<ComponentActivity>()
|
val rule = createAndroidComposeRule<ComponentActivity>()
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
fun `clicking on back invokes the expected callback`() {
|
fun `clicking on back invokes the expected callback`() {
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnce {
|
ensureCalledOnce {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
eventSink = eventsRecorder,
|
eventSink = eventsRecorder,
|
||||||
),
|
),
|
||||||
@@ -56,7 +56,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
fun `clicking on New room invokes the expected callback`() {
|
fun `clicking on New room invokes the expected callback`() {
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnce {
|
ensureCalledOnce {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
eventSink = eventsRecorder,
|
eventSink = eventsRecorder,
|
||||||
),
|
),
|
||||||
@@ -71,7 +71,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
fun `clicking on Invite people invokes the expected callback`() {
|
fun `clicking on Invite people invokes the expected callback`() {
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnce {
|
ensureCalledOnce {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
applicationName = "test",
|
applicationName = "test",
|
||||||
eventSink = eventsRecorder,
|
eventSink = eventsRecorder,
|
||||||
@@ -90,7 +90,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
val firstRoom = recentDirectRoomList[0]
|
val firstRoom = recentDirectRoomList[0]
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnceWithParam(firstRoom.roomId) {
|
ensureCalledOnceWithParam(firstRoom.roomId) {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
userListState = aUserListState(
|
userListState = aUserListState(
|
||||||
recentDirectRooms = recentDirectRoomList
|
recentDirectRooms = recentDirectRoomList
|
||||||
@@ -108,7 +108,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
fun `clicking on Join room by address invokes the expected callback`() {
|
fun `clicking on Join room by address invokes the expected callback`() {
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnce {
|
ensureCalledOnce {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
eventSink = eventsRecorder,
|
eventSink = eventsRecorder,
|
||||||
),
|
),
|
||||||
@@ -122,7 +122,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
fun `clicking on room directory invokes the expected callback`() {
|
fun `clicking on room directory invokes the expected callback`() {
|
||||||
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<StartChatEvents>(expectEvents = false)
|
||||||
ensureCalledOnce {
|
ensureCalledOnce {
|
||||||
rule.setCreateRoomRootView(
|
rule.setStartChatView(
|
||||||
aCreateRoomRootState(
|
aCreateRoomRootState(
|
||||||
eventSink = eventsRecorder,
|
eventSink = eventsRecorder,
|
||||||
isRoomDirectorySearchEnabled = true
|
isRoomDirectorySearchEnabled = true
|
||||||
@@ -134,7 +134,7 @@ class CreateBaseRoomRootViewTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setCreateRoomRootView(
|
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setStartChatView(
|
||||||
state: StartChatState,
|
state: StartChatState,
|
||||||
onCloseClick: () -> Unit = EnsureNeverCalled(),
|
onCloseClick: () -> Unit = EnsureNeverCalled(),
|
||||||
onNewRoomClick: () -> Unit = EnsureNeverCalled(),
|
onNewRoomClick: () -> Unit = EnsureNeverCalled(),
|
||||||
@@ -144,7 +144,7 @@ private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setCreat
|
|||||||
onRoomDirectorySearchClick: () -> Unit = EnsureNeverCalled(),
|
onRoomDirectorySearchClick: () -> Unit = EnsureNeverCalled(),
|
||||||
) {
|
) {
|
||||||
setContent {
|
setContent {
|
||||||
CreateRoomRootView(
|
StartChatView(
|
||||||
state = state,
|
state = state,
|
||||||
onCloseClick = onCloseClick,
|
onCloseClick = onCloseClick,
|
||||||
onNewRoomClick = onNewRoomClick,
|
onNewRoomClick = onNewRoomClick,
|
||||||
Reference in New Issue
Block a user