Merge pull request #1161 from vector-im/feature/fre/polls_timeline_item_tests
[Polls] Add unit tests for TimelineItemContentPollFactory
This commit is contained in:
commit
48413bd508
5 changed files with 287 additions and 4 deletions
|
|
@ -69,7 +69,6 @@ class TimelineItemContentPollFactory @Inject constructor(
|
|||
return TimelineItemPollContent(
|
||||
question = content.question,
|
||||
answerItems = answerItems,
|
||||
votes = content.votes,
|
||||
pollKind = content.kind,
|
||||
isEnded = isEndedPoll,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,5 @@ fun aTimelineItemPollContent(): TimelineItemPollContent {
|
|||
question = "What type of food should we have at the party?",
|
||||
answerItems = aPollAnswerItemList(),
|
||||
isEnded = false,
|
||||
votes = emptyMap(),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue