mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Test ready option view states.
This commit is contained in:
parent
2cf40cbcf2
commit
0f0492db3b
1 changed files with 15 additions and 0 deletions
|
@ -185,4 +185,19 @@ class PollItemFactoryTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `given a sent poll then all option view states is PollReady`() = runTest {
|
||||
with(pollItemFactory) {
|
||||
A_POLL_CONTENT
|
||||
.getBestPollCreationInfo()
|
||||
?.answers
|
||||
?.mapToOptions(PollState.Sending, A_MESSAGE_INFORMATION_DATA)
|
||||
?.forEachIndexed { index, pollOptionViewState ->
|
||||
A_POLL_CONTENT.getBestPollCreationInfo()?.answers?.get(index)?.let { option ->
|
||||
pollOptionViewState shouldBeEqualTo PollOptionViewState.PollSending(option.id ?: "", option.getBestAnswer() ?: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue