Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

[Android] Add fake mode for compose state for testing #796

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

jonnyandrew
Copy link
Contributor

Changes

  • Add fake mode for the compose state for testing and preview purposes
  • Relax visibility of the compose state constructor

Context

As this library inherently requires the underlying Rust model to function properly, it makes testing in a JVM environment difficult. A simple fake implementation allows unit tests to observe some simple state changes after calling functions on the state holder.

@jonnyandrew jonnyandrew requested a review from a team September 7, 2023 08:48
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Patch coverage: 96.15% and project coverage change: -0.05% ⚠️

Comparison is base (aa38f74) 88.27% compared to head (5a1daff) 88.23%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #796      +/-   ##
============================================
- Coverage     88.27%   88.23%   -0.05%     
- Complexity      354      370      +16     
============================================
  Files           153      123      -30     
  Lines         17815    16340    -1475     
  Branches        857      258     -599     
============================================
- Hits          15727    14417    -1310     
+ Misses         1855     1716     -139     
+ Partials        233      207      -26     
Flag Coverage Δ
uitests 68.01% <9.61%> (-6.72%) ⬇️
uitests-android 68.01% <9.61%> (-1.57%) ⬇️
uitests-ios ?
unittests 88.18% <96.07%> (+1.17%) ⬆️
unittests-android 52.01% <96.07%> (+3.77%) ⬆️
unittests-ios ?
unittests-rust 89.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ent/android/wysiwyg/compose/RichTextEditorState.kt 66.66% <77.77%> (+7.29%) ⬆️
.../element/android/wysiwyg/compose/RichTextEditor.kt 63.09% <100.00%> (+2.38%) ⬆️
...oid/wysiwyg/compose/internal/FakeViewConnection.kt 100.00% <100.00%> (ø)

... and 31 files with indirect coverage changes

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@langleyd langleyd left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@jonnyandrew jonnyandrew merged commit eaf2e05 into main Sep 7, 2023
@jonnyandrew jonnyandrew deleted the jonny/fake-compose branch September 7, 2023 12:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants