Skip to content

chore(deps): bump Robolectric 4.14.1 → 4.16.1, refactor MediaStore tests#48

Merged
momentmaker merged 1 commit intomainfrom
chore/robolectric-4.16
Apr 25, 2026
Merged

chore(deps): bump Robolectric 4.14.1 → 4.16.1, refactor MediaStore tests#48
momentmaker merged 1 commit intomainfrom
chore/robolectric-4.16

Conversation

@momentmaker
Copy link
Copy Markdown
Member

Summary

  • Supersedes chore(deps): Bump org.robolectric:robolectric from 4.14.1 to 4.16.1 #34. Bumps Robolectric to 4.16.1 and adapts two tests that were depending on 4.14's broken MediaStore shadow.
  • 4.16 fixed the media provider shadow — inserts and openFileDescriptor now succeed by default. Two tests had used the broken-shadow as a way to provoke the saver's "save failed" branch, and they now see Success.

Changes

  • EtegamiGallerySaverTest: register a NullInsertProvider for the media authority via ShadowContentResolver.registerProviderInternal to force resolver.insert to return null. Mirrors the real-device failure mode (out-of-disk, locked storage volume) and lets us assert SaveResult.Failed strictly without depending on a Robolectric bug.
  • WalkSummaryViewModelTest: drop saveEtegamiToGallery emits SaveFailed under Robolectric MediaStore. It tested the same negative path one layer up; the VM's Failed → SaveFailed mapping is a one-line when arm and not worth a fake-saver injection seam to keep alive.

Test plan

🤖 Generated with Claude Code

Robolectric 4.16 fixed its `MediaStore` shadow so inserts and
`openFileDescriptor` now succeed against the default `media`
provider. Two negative-path tests had been written against 4.14's
broken shadow as a way to exercise the saver's "save failed"
branch — under 4.16 those tests now see Success and fail.

EtegamiGallerySaverTest: register a `NullInsertProvider` for the
`media` authority via `ShadowContentResolver.registerProviderInternal`
to force `resolver.insert` to return null. Mirrors the real-device
failure mode (e.g., out-of-disk, locked storage volume) where the
system MediaProvider rejects the row, and lets us assert
`SaveResult.Failed` strictly without depending on a Robolectric
implementation bug.

WalkSummaryViewModelTest: drop `saveEtegamiToGallery emits SaveFailed
under Robolectric MediaStore`. It tested the same negative path one
layer up, and the VM's `Failed → SaveFailed` mapping is a one-line
`when` arm covered structurally; not worth a separate VM-level
fake-saver injection seam to keep this redundant test alive.

Closes #34.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@momentmaker momentmaker merged commit 7eac7d6 into main Apr 25, 2026
1 check passed
@momentmaker momentmaker deleted the chore/robolectric-4.16 branch April 25, 2026 16:41
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