test(compose): Robolectric JVM tests — mailbox screen + folder drawer (#383) #416

Merged
JMR-dev merged 2 commits from test-383-robolectric-mailbox into main 2026-07-07 06:11:43 +00:00
JMR-dev commented 2026-07-07 05:08:49 +00:00 (Migrated from github.com)

Batch 8/9 of the Robolectric Compose umbrella #373. Converts the Paging 3 mailbox list + folder drawer to Robolectric JVM Compose tests and drops both from jacocoNonJvmTestableSurface.

What

  • MailboxScreenJvmTest (19 tests) — drives the real MailboxScreen + MailboxViewModel over mocked MailRepository/AccountRepository/Syncer. Paging 3 is fed on the JVM with static PagingData.from flows (no real Room/Paging source), mirroring MailboxViewModelTest. Covers: the no-accounts welcome fallback, the populated list (sender/subject/snippet, offline badge, unified per-account labels + account-filter chips, drafts/outbox entries + nav), the empty / still-loading / no-results states (explicit LoadStates), search open→hint→close, and the multi-select contextual action bar (long-press entry + count, overflow reply-actions single vs multi, direct archive, spam/delete confirm dialogs + cancel, move picker, archive-hidden-while-in-archive, and the disambiguated app-bar title).
  • FolderDrawerJvmTest (8 tests) — drives the callback-driven FolderDrawer: friendly role names, duplicate-name provider disambiguation + the account-switch gap (#61), folder-tap reporting, the multi-account switcher + "All Inboxes" + switcher dropdown, and the unread badge (incl. the "99+" cap).

JaCoCo

  • Removed **/MailboxScreen* and **/FolderDrawer* from jacocoNonJvmTestableSurface (append-discipline: no other entry touched; isIncludeNoLocationClasses and the 0.79 floor left unchanged — the re-ratchet is the final #373 step).
  • Overall JVM line coverage: 84.69% (6716/7930), well above the 0.79 floor.

Notes

  • The instrumented MailboxScreenTest / FolderDrawerTest stay as the on-device E2E.
  • Test-only change — no app source edited, so no new logging.

Gate (all green locally)

assembleDebug + testDebugUnitTest + jacocoTestCoverageVerification + compileDebugAndroidTestKotlin + lintDebug + ktlintCheck + detekt.

🤖 Generated with Claude Code

Batch 8/9 of the Robolectric Compose umbrella #373. Converts the Paging 3 mailbox list + folder drawer to Robolectric JVM Compose tests and drops both from `jacocoNonJvmTestableSurface`. ## What - **`MailboxScreenJvmTest`** (19 tests) — drives the real `MailboxScreen` + `MailboxViewModel` over mocked `MailRepository`/`AccountRepository`/`Syncer`. Paging 3 is fed on the JVM with static `PagingData.from` flows (no real Room/Paging source), mirroring `MailboxViewModelTest`. Covers: the no-accounts welcome fallback, the populated list (sender/subject/snippet, offline badge, unified per-account labels + account-filter chips, drafts/outbox entries + nav), the empty / still-loading / no-results states (explicit `LoadStates`), search open→hint→close, and the multi-select contextual action bar (long-press entry + count, overflow reply-actions single vs multi, direct archive, spam/delete confirm dialogs + cancel, move picker, archive-hidden-while-in-archive, and the disambiguated app-bar title). - **`FolderDrawerJvmTest`** (8 tests) — drives the callback-driven `FolderDrawer`: friendly role names, duplicate-name provider disambiguation + the account-switch gap (#61), folder-tap reporting, the multi-account switcher + "All Inboxes" + switcher dropdown, and the unread badge (incl. the "99+" cap). ## JaCoCo - Removed `**/MailboxScreen*` and `**/FolderDrawer*` from `jacocoNonJvmTestableSurface` (append-discipline: no other entry touched; `isIncludeNoLocationClasses` and the `0.79` floor left unchanged — the re-ratchet is the final #373 step). - Overall JVM line coverage: **84.69%** (6716/7930), well above the 0.79 floor. ## Notes - The instrumented `MailboxScreenTest` / `FolderDrawerTest` stay as the on-device E2E. - Test-only change — no app source edited, so no new logging. ## Gate (all green locally) `assembleDebug` + `testDebugUnitTest` + `jacocoTestCoverageVerification` + `compileDebugAndroidTestKotlin` + `lintDebug` + `ktlintCheck` + `detekt`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.