Fixing NoSuchElement list empty in PostDayViewsUseCase#10850
Fixing NoSuchElement list empty in PostDayViewsUseCase#10850planarvoid merged 5 commits intodevelopfrom
Conversation
|
You can test the changes on this Pull Request by downloading the APK here. |
planarvoid
left a comment
There was a problem hiding this comment.
Thanks for the changes, the code looks good 👍 Do you think you can add a test for the PostDayViewsUseCase for the case when the dayViews list is empty?
# Resolved Conflicts in: # WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostDayViewsUseCase.kt
|
Hey @planarvoid 👋
Sure, makes sense! I added a test case as requested; since I'm not much familiar with the stats part of the app (as you are instead 😊), I'm not fully sure the Empty state is what we actually expect (that is if I created the correct preconditions for the test) so appreciate your usual valuable feedback! 😎 |
|
hey @develric, thanks for the changes. If I understand it correctly, we're fixing here an edge case where the |
|
Thanks for the clarifying explanation @planarvoid 🙇♂️! I have reported changes here with an extra comment to get the context. Let me know 😊. |
|
thanks for the change @develric ! The comment makes a lot of sense 👍 |
Fixes #10830
This PR does two things:
OverviewUseCase.buildUiModel(that is introduced a check for the list not being empty)PostDayViewsUseCase.fetchRemoteDatain case of error I usedselectedDateProvider.onDateLoadingFailedinsetad ofselectedDateProvider.onDateLoadingSucceededTo test:
Since it was not possible to reproduce, I think we can only make sure we did not introduce issues in the relevant stats card, so smoke test the post day/views card with different sites/posts and compare with the not modified WordPress app to check you get the same visualizations.
PR submission checklist:
I have considered adding unit tests where possible.
I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txtif necessary.