-
Notifications
You must be signed in to change notification settings - Fork 233
[Polls] Add unit tests for TimelineItemContentPollFactory #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #1161 +/- ##
===========================================
+ Coverage 56.87% 57.01% +0.14%
===========================================
Files 1039 1039
Lines 26812 26817 +5
Branches 5544 5544
===========================================
+ Hits 15248 15291 +43
+ Misses 9168 9127 -41
- Partials 2396 2399 +3
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding tests on this area. Some non-blocking remarks.
...ent/android/features/messages/timeline/factories/event/TimelineItemContentPollFactoryTest.kt
Outdated
Show resolved
Hide resolved
A_POLL_ANSWER_4.id to listOf(A_USER_ID_10), | ||
) | ||
Truth.assertThat( | ||
factory.create(aPollContent(PollKind.Disclosed).copy(votes = votes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Instead of copying, maybe add more parameters with default values to the fun aPollContent
? Same remark for aTimelineItemPollContent
and aPollAnswerItem
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I tried to factorize a bit. I chose to duplicate the parameters to have a better view of the initial state and the resulting state at the same time.
Let me know if you prefer this format. I could not find a way to deduplicate the expected results since there are some differences on each test case :/
...ent/android/features/messages/timeline/factories/event/TimelineItemContentPollFactoryTest.kt
Outdated
Show resolved
Hide resolved
18645c3
to
fb6a036
Compare
fb6a036
to
992050c
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
Type of change
Content
Add unit tests for
TimelineItemContentPollFactory
.Motivation and context
Ensure the TimelineItemContentPollFactory produces the expected UI models from a
PollContent
.Check that correct answers are detected as winners and that votes are only disclosed when they are supposed to be.
Checklist