Skip to content

Improve the TextViewMapper unit tests#2034

Merged
xgouchet merged 1 commit into
developfrom
xgouchet/sr_ut_textviewmapper
May 16, 2024
Merged

Improve the TextViewMapper unit tests#2034
xgouchet merged 1 commit into
developfrom
xgouchet/sr_ut_textviewmapper

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

Split the logic of the TextViewMapper in two classes: TextViewMapper and EditTextViewMapper, to simplify some of the logic and make testing easier.

@xgouchet
xgouchet requested review from a team as code owners May 15, 2024 14:14
SwitchCompat::class.java,
SwitchCompatMapper(
textViewMapper,
textViewMapper as TextViewMapper<SwitchCompat>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this part with explicit casting looks dangerous and not very obvious (partially because it is not obvious that SwitchCompat, etc. are sub-classes of TextView). Is there a way to avoid explicit cast?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Those cast are totally safe, but I agree they are not obvious.
They are temporary though, the next PRs will be about letting SwitchCompatMapper(and others) extend TextViewMapper instead.

@codecov-commenter

codecov-commenter commented May 15, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.51163% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 82.93%. Comparing base (34b4ff3) to head (a814f9f).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2034      +/-   ##
===========================================
- Coverage    83.14%   82.93%   -0.22%     
===========================================
  Files          495      491       -4     
  Lines        17721    17700      -21     
  Branches      2689     2683       -6     
===========================================
- Hits         14734    14678      -56     
- Misses        2242     2285      +43     
+ Partials       745      737       -8     
Files Coverage Δ
.../sessionreplay/internal/DefaultRecorderProvider.kt 85.71% <100.00%> (+0.81%) ⬆️
...ionreplay/internal/recorder/mapper/ButtonMapper.kt 87.50% <100.00%> (ø)
...nreplay/internal/recorder/mapper/CheckBoxMapper.kt 100.00% <ø> (ø)
...l/recorder/mapper/CheckableCompoundButtonMapper.kt 94.74% <ø> (ø)
...nternal/recorder/mapper/CheckableTextViewMapper.kt 56.90% <100.00%> (-39.66%) ⬇️
.../internal/recorder/mapper/CheckedTextViewMapper.kt 95.65% <ø> (ø)
...play/internal/recorder/mapper/RadioButtonMapper.kt 73.33% <ø> (ø)
...lay/internal/recorder/mapper/SwitchCompatMapper.kt 71.32% <100.00%> (-8.53%) ⬇️
...recorder/obfuscator/FixedLengthStringObfuscator.kt 100.00% <100.00%> (ø)
...order/mapper/BaseAsyncBackgroundWireframeMapper.kt 94.92% <100.00%> (-0.17%) ⬇️
... and 2 more

... and 27 files with indirect coverage changes

@xgouchet
xgouchet merged commit 988232e into develop May 16, 2024
@xgouchet
xgouchet deleted the xgouchet/sr_ut_textviewmapper branch May 16, 2024 14:11
@xgouchet xgouchet added this to the 2.10.x milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants