mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
RoomList: try to fix the test in ci...
This commit is contained in:
+2
-1
@@ -79,6 +79,7 @@ import kotlinx.coroutines.test.TestScope
|
|||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
class RoomListPresenterTests {
|
class RoomListPresenterTests {
|
||||||
@get:Rule
|
@get:Rule
|
||||||
@@ -158,7 +159,7 @@ class RoomListPresenterTests {
|
|||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
val initialState = consumeItemsUntilPredicate { state -> state.roomList.dataOrNull()?.size == 16 }.last()
|
val initialState = consumeItemsUntilPredicate(timeout = 3.seconds) { state -> state.roomList.dataOrNull()?.size == 16 }.last()
|
||||||
// Room list is loaded with 16 placeholders
|
// Room list is loaded with 16 placeholders
|
||||||
val initialItems = initialState.roomList.dataOrNull().orEmpty()
|
val initialItems = initialState.roomList.dataOrNull().orEmpty()
|
||||||
assertThat(initialItems.size).isEqualTo(16)
|
assertThat(initialItems.size).isEqualTo(16)
|
||||||
|
|||||||
Reference in New Issue
Block a user