From 5a948891f0f8b6b6524d1bde06a81c4fdfd57ffe Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Wed, 22 Jun 2022 13:27:52 +0300 Subject: [PATCH] Test ready poll state. --- .../timeline/factory/PollItemFactoryTest.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vector/src/test/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemFactoryTest.kt b/vector/src/test/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemFactoryTest.kt index 50ddb0afb9..156cde6ff7 100644 --- a/vector/src/test/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemFactoryTest.kt +++ b/vector/src/test/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemFactoryTest.kt @@ -154,4 +154,19 @@ class PollItemFactoryTest { pollContent = disclosedPollContent, ) 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 + } }