-
Notifications
You must be signed in to change notification settings - Fork 252
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
tests(timeline): make use of the EventFactory
more
#3673
Conversation
…m_event` They're the same picture.</meme>
This is `TimelineInner::add_events_at` with fixed parameters.
Callers can make use of the `EventFactory` which is easier to understand IMO, and that avoids a special testing function just for this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3673 +/- ##
==========================================
- Coverage 84.31% 84.30% -0.01%
==========================================
Files 259 259
Lines 26720 26726 +6
==========================================
+ Hits 22529 22532 +3
- Misses 4191 4194 +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.
Great, thanks!
…ine::handle_live_reaction` The `EventFactory` is improved to support creating those events too, reducing the number of custom events creators everywhere.
The `EventFactory` can build events with a specific `event_id` already.
…ne::handle_live_reaction`
1057223
to
eec9128
Compare
The
TestTimeline
had lots and lots of custom methods for creating test events and handling them immediately. Since theEventFactory
helper makes it possible to easily create events, there's no need to repeat those responsibilities in the timeline testing code itself, and we can make more use of theEventFactory
instead.There's much more to do there; ideally, we'd get rid of most of
TestTimeline::handle_
methods (we'd keephandle_live_events
), as well asEventBuilder
entirely, which API isn't flexible at all. Could be some nice and fun good-first-bugs 😎