Skip to content

test: +29 unit tests across the recently-touched areas (37 → 66)#13

Open
fabiodalez-dev wants to merge 1 commit into
feat/sentry-crash-reportingfrom
test/coverage-touched-areas
Open

test: +29 unit tests across the recently-touched areas (37 → 66)#13
fabiodalez-dev wants to merge 1 commit into
feat/sentry-crash-reportingfrom
test/coverage-touched-areas

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

Fourth in the series. Stacked on #12 (Sentry) → #11#10#9, so the tests can reference the offline cache, the sync worker, and the rest.

What

29 new unit tests over the code we just added/changed. Suite grows 37 → 66 green.

File Tests Covers
CatalogDaoEdgeTest 5 Room cache: empty replaceAll clears, position ordering, snapshot swap, count-after-clear, 50-item batch
CachedBookMapperEdgeTest 5 entity↔summary: all-null & full round-trips, position/id independence, availability flags
BookSummaryEdgeTest 4 availability boundaries (1 / 0 / negative copies), authorsLabel
StatusMappingMoreTest 7 loan()/reservation() colour buckets + title-cased fallback, loanGroup() priority ordering
DateFormatMoreTest 3 offset timestamp, unparseable passthrough, todayIso
NetworkUrlMoreTest 4 port kept, origin derivation, http loopback/emulator allowed vs public http rejected
CatalogSyncWorkerTest 1 WorkManager worker degrades to a successful no-op (via work-testing)

Adds androidx.work:work-testing as a test dependency.

Verified

testDebugUnitTest 66/66 green.

Covers the offline-cache + sync + status/date logic we just added/changed; the
suite goes from 37 to 66 green.

- CatalogDaoEdgeTest (5): empty replaceAll clears, position ordering with
  non-sequential positions, snapshot swap, count-after-clear, 50-item batch.
- CachedBookMapperEdgeTest (5): all-null and fully-populated round-trips, position
  vs id independence, availability-flag preservation.
- BookSummaryEdgeTest (4): availability boundaries (1 copy, 0, negative), authorsLabel.
- StatusMappingMoreTest (7): loan()/reservation() colour buckets + title-cased
  fallback, loanGroup() priority ordering and default.
- DateFormatMoreTest (3): offset timestamp, unparseable dateTime passthrough, todayIso.
- NetworkUrlMoreTest (4): explicit port, origin derivation, http loopback/emulator
  allowed vs public http rejected.
- CatalogSyncWorkerTest (1): WorkManager worker degrades to a successful no-op under
  a non-Pinakes Application context (via work-testing TestListenableWorkerBuilder).

Adds androidx.work:work-testing as a test dependency.
Verified: testDebugUnitTest 66/66 green.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d58983b1-8752-42b7-9b50-771605800ff8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/coverage-touched-areas

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant