Test ready poll state.

This commit is contained in:
Onuray Sahin 2022-06-22 13:27:52 +03:00
parent 2c5ddca821
commit 5a948891f0

View file

@ -154,4 +154,19 @@ class PollItemFactoryTest {
pollContent = disclosedPollContent, pollContent = disclosedPollContent,
) shouldBeEqualTo PollState.Voted(1) ) shouldBeEqualTo PollState.Voted(1)
} }
@Test
fun `given a sent poll when poll type is disclosed then PollState is Ready`() = runTest {
val disclosedPollContent = A_POLL_CONTENT.copy(
unstablePollCreationInfo = A_POLL_CONTENT.getBestPollCreationInfo()?.copy(
kind = PollType.DISCLOSED_UNSTABLE
)
)
pollItemFactory.createPollState(
informationData = A_MESSAGE_INFORMATION_DATA,
pollResponseSummary = A_POLL_RESPONSE_DATA,
pollContent = disclosedPollContent,
) shouldBe PollState.Ready
}
} }