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 6c4f9e872e..be397e25ea 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 @@ -265,4 +265,18 @@ class PollItemFactoryTest { } } } + + @Test + fun `given a poll state when it is not Sending and not Ended then the poll is votable`() = runTest { + val sendingPollState = PollState.Sending + sendingPollState.isVotable() shouldBe false + val readyPollState = PollState.Ready + readyPollState.isVotable() shouldBe true + val votedPollState = PollState.Voted(1) + votedPollState.isVotable() shouldBe true + val undisclosedPollState = PollState.Undisclosed + undisclosedPollState.isVotable() shouldBe true + var endedPollState = PollState.Ended + endedPollState.isVotable() shouldBe false + } }