Test ready option view states.

This commit is contained in:
Onuray Sahin 2022-06-22 15:27:04 +03:00
parent 2cf40cbcf2
commit 0f0492db3b
1 changed files with 15 additions and 0 deletions

View File

@ -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() ?: "")
}
}
}
}
}