Cleanup
This commit is contained in:
parent
cde64d4860
commit
0889752239
3 changed files with 3 additions and 4 deletions
|
|
@ -57,7 +57,6 @@ class RoomListPresenter @Inject constructor(
|
||||||
mutableStateOf(null)
|
mutableStateOf(null)
|
||||||
}
|
}
|
||||||
var filter by rememberSaveable { mutableStateOf("") }
|
var filter by rememberSaveable { mutableStateOf("") }
|
||||||
val isLoginOut = rememberSaveable { mutableStateOf(false) }
|
|
||||||
val roomSummaries by client
|
val roomSummaries by client
|
||||||
.roomSummaryDataSource()
|
.roomSummaryDataSource()
|
||||||
.roomSummaries()
|
.roomSummaries()
|
||||||
|
|
@ -86,7 +85,6 @@ class RoomListPresenter @Inject constructor(
|
||||||
matrixUser = matrixUser.value,
|
matrixUser = matrixUser.value,
|
||||||
roomList = filteredRoomSummaries.value,
|
roomList = filteredRoomSummaries.value,
|
||||||
filter = filter,
|
filter = filter,
|
||||||
isLoginOut = isLoginOut.value,
|
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvents
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,5 @@ data class RoomListState(
|
||||||
val matrixUser: MatrixUser?,
|
val matrixUser: MatrixUser?,
|
||||||
val roomList: ImmutableList<RoomListRoomSummary>,
|
val roomList: ImmutableList<RoomListRoomSummary>,
|
||||||
val filter: String,
|
val filter: String,
|
||||||
val isLoginOut: Boolean,
|
|
||||||
val eventSink: (RoomListEvents) -> Unit
|
val eventSink: (RoomListEvents) -> Unit
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:OptIn(ExperimentalCoroutinesApi::class)
|
||||||
|
|
||||||
package io.element.android.features.roomlist
|
package io.element.android.features.roomlist
|
||||||
|
|
||||||
import app.cash.molecule.RecompositionClock
|
import app.cash.molecule.RecompositionClock
|
||||||
|
|
@ -22,6 +24,7 @@ import app.cash.turbine.test
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.libraries.matrix.core.SessionId
|
import io.element.android.libraries.matrix.core.SessionId
|
||||||
import io.element.android.libraries.matrixtest.FakeMatrixClient
|
import io.element.android.libraries.matrixtest.FakeMatrixClient
|
||||||
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
@ -29,7 +32,6 @@ class RoomListPresenterTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - should start with no user and then load user with success`() = runTest {
|
fun `present - should start with no user and then load user with success`() = runTest {
|
||||||
|
|
||||||
val presenter = RoomListPresenter(
|
val presenter = RoomListPresenter(
|
||||||
FakeMatrixClient(
|
FakeMatrixClient(
|
||||||
SessionId("sessionId")
|
SessionId("sessionId")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue