chore(deps): bump Robolectric 4.14.1 → 4.16.1, refactor MediaStore tests#48
Merged
momentmaker merged 1 commit intomainfrom Apr 25, 2026
Merged
chore(deps): bump Robolectric 4.14.1 → 4.16.1, refactor MediaStore tests#48momentmaker merged 1 commit intomainfrom
momentmaker merged 1 commit intomainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MediaStoreshadow.mediaprovider shadow — inserts andopenFileDescriptornow succeed by default. Two tests had used the broken-shadow as a way to provoke the saver's "save failed" branch, and they now seeSuccess.Changes
EtegamiGallerySaverTest: register aNullInsertProviderfor themediaauthority viaShadowContentResolver.registerProviderInternalto forceresolver.insertto return null. Mirrors the real-device failure mode (out-of-disk, locked storage volume) and lets us assertSaveResult.Failedstrictly without depending on a Robolectric bug.WalkSummaryViewModelTest: dropsaveEtegamiToGallery emits SaveFailed under Robolectric MediaStore. It tested the same negative path one layer up; the VM'sFailed → SaveFailedmapping is a one-linewhenarm and not worth a fake-saver injection seam to keep alive.Test plan
./gradlew :app:testDebugUnitTestpasses locally./gradlew :app:lintDebugpasses locally🤖 Generated with Claude Code