Fix more test.
This commit is contained in:
parent
5d4eaae933
commit
dca7edd977
1 changed files with 14 additions and 9 deletions
|
|
@ -52,14 +52,15 @@ class PollHistoryPresenterTest {
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
private val room = FakeMatrixRoom(
|
private val timeline = aPollTimeline(
|
||||||
matrixTimeline = aPollTimeline(
|
polls = mapOf(
|
||||||
polls = mapOf(
|
AN_EVENT_ID to anOngoingPollContent(),
|
||||||
AN_EVENT_ID to anOngoingPollContent(),
|
AN_EVENT_ID_2 to anEndedPollContent()
|
||||||
AN_EVENT_ID_2 to anEndedPollContent()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
private val room = FakeMatrixRoom(
|
||||||
|
matrixTimeline = timeline
|
||||||
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - initial states`() = runTest {
|
fun `present - initial states`() = runTest {
|
||||||
|
|
@ -134,10 +135,14 @@ class PollHistoryPresenterTest {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
consumeItemsUntilPredicate {
|
consumeItemsUntilPredicate {
|
||||||
it.pollHistoryItems.size == 2 && !it.isLoading
|
it.pollHistoryItems.size == 2
|
||||||
}.last().also { state ->
|
|
||||||
state.eventSink(PollHistoryEvents.LoadMore)
|
|
||||||
}
|
}
|
||||||
|
timeline.updatePaginationState {
|
||||||
|
copy(isBackPaginating = false)
|
||||||
|
}
|
||||||
|
val loadedState = awaitItem()
|
||||||
|
assertThat(loadedState.isLoading).isFalse()
|
||||||
|
loadedState.eventSink(PollHistoryEvents.LoadMore)
|
||||||
consumeItemsUntilPredicate {
|
consumeItemsUntilPredicate {
|
||||||
it.isLoading
|
it.isLoading
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue