Skip to content
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

Cleanup tests #3645

Closed
wants to merge 11 commits into from
Closed

Cleanup tests #3645

wants to merge 11 commits into from

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 10, 2024

Content

Cleanup test.
Make AsyncAction.Confirming having a field to be able to reduce the number of recomposition. This is impacting lots of file, but I did not find an easy way to let C be Unit by default.
Rework Moderation presenter to make it a bit more live.

Motivation and context

Cleaner code.

Screenshots / GIFs

Tests

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner October 10, 2024 13:48
@bmarty bmarty requested review from ganfra and removed request for a team October 10, 2024 13:48
Copy link
Contributor

github-actions bot commented Oct 10, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/e5J3Df

@bmarty bmarty added PR-Misc For other changes Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Oct 10, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Oct 10, 2024
Copy link

sonarcloud bot commented Oct 10, 2024

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 93.91026% with 19 lines in your changes missing coverage. Please review.

Project coverage is 82.83%. Comparing base (366db47) to head (72de6a7).
Report is 24 commits behind head on develop.

Files with missing lines Patch % Lines
...pl/members/moderation/RoomMembersModerationView.kt 89.85% 4 Missing and 3 partials ⚠️
...es/invite/impl/response/AcceptDeclineInviteView.kt 57.14% 2 Missing and 1 partial ⚠️
...mbers/moderation/RoomMembersModerationPresenter.kt 90.32% 0 Missing and 3 partials ⚠️
...ndroid/libraries/matrix/ui/room/MatrixRoomState.kt 75.00% 0 Missing and 3 partials ⚠️
...d/features/lockscreen/impl/unlock/PinUnlockView.kt 0.00% 0 Missing and 1 partial ⚠️
...atures/verifysession/impl/VerifySelfSessionView.kt 0.00% 0 Missing and 1 partial ⚠️
...ment/android/libraries/architecture/AsyncAction.kt 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3645      +/-   ##
===========================================
+ Coverage    82.82%   82.83%   +0.01%     
===========================================
  Files         1747     1747              
  Lines        41742    41753      +11     
  Branches      5102     5105       +3     
===========================================
+ Hits         34572    34586      +14     
  Misses        5355     5355              
+ Partials      1815     1812       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change number of recomposition for tests, but in real life it won't change anything as it's not using the same composition clock between app and tests

*/
@Stable
sealed interface AsyncAction<out T> {
sealed interface AsyncAction<out C, out T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of adding new type everywhere, we could let the Confirming be an interface you can inherits only you have data to confirm?

interface Confirming : AsyncAction<Nothing>
data object SimpleConfirmation : Confirming
val unbanUserAsyncAction: AsyncAction<Unit>
data class UnbanUserActionConfirmation(val member: RoomMember): Confirming

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in #3667.

@bmarty
Copy link
Member Author

bmarty commented Oct 14, 2024

I will split this random PR into smaller ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moderation: kicking (removing) member of a room is broken
3 participants