Skip to content

Add unit tests for the RS comments - #23090

Merged
nbradbury merged 6 commits into
trunkfrom
rs-comments-tests
Jul 13, 2026
Merged

Add unit tests for the RS comments#23090
nbradbury merged 6 commits into
trunkfrom
rs-comments-tests

Conversation

@nbradbury

@nbradbury nbradbury commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds unit-test coverage for the wordpress-rs comments experience that was missing from earlier PRs. No production code changes.

RS comments list — restores the list tests that were removed to shrink the Phase 2 list PRs (#23061 / #23062 / #23063).

Comment detail HTML body — adds Robolectric tests for the CommentHtmlBody parsing helpers introduced with the detail Compose conversion (#23078).

Testing

./gradlew :WordPress:testWordPressDebugUnitTest --tests '*CommentsRsListViewModelTest' --tests '*CommentsRsDataSourceTest' --tests '*CommentsRsListMappingTest' --tests '*CommentsRsListTabTest' --tests '*CommentHtmlBodyTest' → 51 passed, 0 failures.

Restores the wordpress-rs comments-list tests that were removed to shrink the
Phase 2 list PRs (#23061/#23062/#23063). Covers the list ViewModel, the rs data
source, status/tab mapping, and tab modelling: 41 tests, all green against
current trunk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dangermattic

dangermattic commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@nbradbury nbradbury changed the title Add parked unit tests for the RS comments list Add unit tests for the RS comments list Jul 10, 2026
@wpmobilebot

wpmobilebot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23090-4ad83b8
Build Number1498
Application IDcom.jetpack.android.prealpha
Commit4ad83b8
Installation URL012i2kj3fn008
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23090-4ad83b8
Build Number1498
Application IDorg.wordpress.android.prealpha
Commit4ad83b8
Installation URL2p3remru23lgo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.55%. Comparing base (6a3c3b8) to head (4ad83b8).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #23090      +/-   ##
==========================================
+ Coverage   37.36%   37.55%   +0.18%     
==========================================
  Files        2340     2340              
  Lines      127024   127024              
  Branches    17517    17517              
==========================================
+ Hits        47465    47705     +240     
+ Misses      75672    75412     -260     
- Partials     3887     3907      +20     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Covers the CommentHtmlBody helpers introduced with the detail Compose
conversion: splitCommentHtml's text/image segment boundaries (ordering,
blank-segment trimming, src-less img tags) and commentHtmlToAnnotatedString's
link annotation and block-whitespace trimming. Robolectric-run because both
reach android.text.Html/HtmlCompat.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nbradbury nbradbury changed the title Add unit tests for the RS comments list Add unit tests for the RS comments list and detail HTML body Jul 10, 2026
@nbradbury nbradbury changed the title Add unit tests for the RS comments list and detail HTML body Add unit tests for the RS comments Jul 10, 2026
@nbradbury
nbradbury marked this pull request as ready for review July 10, 2026 17:36
@nbradbury
nbradbury requested a review from adalpari July 10, 2026 17:36
Drop the redundant toRsComment Hold-status test (its status delegation is
already covered by CommentsRsStatusMapperTest and the field-mapping test) and
return a mock for the discarded executor-stub response.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Android Lint flags mocking the uniffi PostsRequestFilterListWithViewContextResponse
data class. Restore the explicit constructor for the discarded executor-stub
response.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@adalpari adalpari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚢 it!

@nbradbury
nbradbury enabled auto-merge (squash) July 13, 2026 10:25
@nbradbury
nbradbury merged commit 19ebc50 into trunk Jul 13, 2026
17 of 20 checks passed
@nbradbury
nbradbury deleted the rs-comments-tests branch July 13, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants