Merge pull request #1161 from vector-im/feature/fre/polls_timeline_item_tests

[Polls] Add unit tests for TimelineItemContentPollFactory
This commit is contained in:
Florian Renaud 2023-08-30 08:32:21 +02:00 committed by GitHub
commit 48413bd508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 287 additions and 4 deletions

View file

@ -69,7 +69,6 @@ class TimelineItemContentPollFactory @Inject constructor(
return TimelineItemPollContent(
question = content.question,
answerItems = answerItems,
votes = content.votes,
pollKind = content.kind,
isEnded = isEndedPoll,
)

View file

@ -17,13 +17,11 @@
package io.element.android.features.messages.impl.timeline.model.event
import io.element.android.features.poll.api.PollAnswerItem
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.poll.PollKind
data class TimelineItemPollContent(
val question: String,
val answerItems: List<PollAnswerItem>,
val votes: Map<String, List<UserId>>,
val pollKind: PollKind,
val isEnded: Boolean,
) : TimelineItemEventContent {

View file

@ -34,6 +34,5 @@ fun aTimelineItemPollContent(): TimelineItemPollContent {
question = "What type of food should we have at the party?",
answerItems = aPollAnswerItemList(),
isEnded = false,
votes = emptyMap(),
)
}