Repository navigation
test(media): real picker-dialog photo-attach forwarding coverage (Refs #1358) - #1409
Conversation
…#1358) Test-hygiene follow-up to merge-gate finding N1 on PR #1397. - Replace ExercisePickerHostPhotoAttachTest (5 tests whose names claimed host coverage but only mounted ExerciseMediaAttachments with a constant; pairwise-identical routineEditorHost_*/workoutAddHost_* pairs and a listThumbnailSuppression test that cannot fail on pre-fix code) with ExerciseMediaAttachGateTest: 2 deduplicated tests whose names claim only component-level SD10 behavior (Add enabled/disabled + preference notice). - Add ExercisePickerDialogPhotoAttachForwardingTest: renders the REAL ExercisePickerDialog with enableVideoPlayback=false / enablePhotoAttach=true, opens the create dialog via the real 'Create Custom Exercise' tap and asserts Add photos is enabled (plus the mirror direction). Fails when ExercisePickerDialog forwards enableVideoPlayback instead of enablePhotoAttach (mutation-probe evidence in the PR). - Harness-only seam: test-only DialogProperties(usePlatformDefaultWidth=false) via new defaulted dialogProperties/createDialogProperties parameters on CreateExerciseDialog/ExercisePickerDialog to dodge the Robolectric Dialog+TextField AppNotIdleException quirk. Defaults are production DialogProperties(); no production call site passes them; production behavior unchanged.
…-attach-gate-discrimination
…1406) Drive-by test-hygiene fix, pre-existing on main at 6f95247 (Unit Tests red there): #1406 landed the real migration 64.sqm (issue #1400 aggregateEligible) without moving ExerciseMediaWiringTest.noMigrationTouchesExerciseImage's sanctioned ratchet ('bump this ratchet only when a real migration lands'). 64.sqm does not touch ExerciseImage (only 43.sqm does, guard (b) intact), so the ratchet moves 63 -> 64. This unblocks the check pipeline on this PR (Build Android / iOS Test Target Compile skip while Unit Tests is red).
|
Main-unblocking drive-by (test-only) at 9be639b: the first CI pass failed Unit Tests on |
Merge gate verdict — PR #1409 @
|
…-attach-gate-discrimination # Conflicts: # shared/src/commonTest/kotlin/com/devil/phoenixproject/presentation/ExerciseMediaWiringTest.kt
|
Merge-to-main re-gate (t_e40b37fa): APPROVED at exact head Scope: post-conflict-resolution delta only; substance was approved at
The earlier mutation-discrimination and seam-neutrality results are not affected by a comment-only delta. Merging via the PR only (squash, |
Refs #1358 (issue closed by #1397 — deliberately NOT
Fixes; no issue-state change).Post-merge test-hygiene follow-up to merge-gate finding N1 (#1397 (comment) §7). Test-only change; no production behavior change.
What was wrong
ExercisePickerHostPhotoAttachTestonly mountedExerciseMediaAttachments(enableAttach = <constant>):routineEditorHost_*/workoutAddHost_*were pairwise identical tests.listThumbnailSuppression_alone_neverDisablesAttachcannot fail on pre-fix code. With the P1 mutation (enablePhotoAttach = enableVideoPlaybackput back inExercisePicker.kt), all 5 tests still passed — only the source-string drift guard caught it.Changes
Renamed + deduped (names now claim only component-level SD10 behavior).
ExercisePickerHostPhotoAttachTest(5 tests) →ExerciseMediaAttachGateTest(2 tests:gateOn_addPhotosEnabled_noPreferenceOffNotice,gateOff_addPhotosDisabled_preferenceOffNoticeShown). Class doc explicitly scopes these toExerciseMediaAttachmentscomponent behavior and points at the real forwarding test + drift guard for host wiring.Real behavioral forwarding test. New
ExercisePickerDialogPhotoAttachForwardingTestrenders the realExercisePickerDialogwithenableVideoPlayback=false, enablePhotoAttach=true(the exact pre-fix host combination), taps Create Custom Exercise (the real user gesture), and asserts Add photos is enabled with no preference-off notice; plus the mirror direction (enableVideoPlayback=true, enablePhotoAttach=false→ disabled + notice). Both tests fail whenExercisePickerDialogforwardsenableVideoPlaybackinstead ofenablePhotoAttach.Harness-only seam (no production behavior change). The documented blocker (Robolectric Dialog + TextField never reaches idle —
AppNotIdleException) is worked around with the suggested test-onlyDialogProperties(usePlatformDefaultWidth = false)seam: new defaulted parametersdialogPropertiesonCreateExerciseDialogandcreateDialogPropertiesonExercisePickerDialog, both defaulting to productionDialogProperties()(exactly what the unparameterizedDialogused). No production call site passes them; production rendering is unchanged. The forwarding line under test is shell-independent.Also updated
ExerciseMediaWiringTestdoc/message references to the renamed test (comments only, no test-name changes).Discrimination proof (mutation probe)
Against the mutation (
enablePhotoAttach = enableVideoPlaybackrestored inExercisePicker.kt:233) —./gradlew -Pskip.supabase.check=true :shared:testAndroidHostTest --tests '…ExercisePickerDialogPhotoAttachForwardingTest' --tests '…ExerciseMediaAttachGateTest':Both new behavioral tests FAIL under the mutation (the 2 component-level tests pass, correctly — they no longer claim host coverage).
Against main code (mutation reverted,
enablePhotoAttach = enablePhotoAttachatExercisePicker.kt:233) — same command:Focused host suite
Full
:shared:testAndroidHostTeston the PR head: 5965 tests, 0 failures, 0 errors (BUILD SUCCESSFUL in 2m 13s), includingExerciseMediaWiringTest(12/12, drift guardphotoAttachGateIsDecoupledFromListThumbnailFlagAtBothHostsgreen) and both new classes.ExercisePickerHostPhotoAttachTestis gone.Acceptance
phoneMainis only the defaultedDialogProperties()seams; no call site passes them)