Repository navigation
test(adapters): close P17 adapter test coverage gaps - #112
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rghamilton3
added a commit
that referenced
this pull request
Apr 16, 2026
All 6 findings from PR #112 review resolved. P19-003 (overrides happy-path coverage) added as B009 in Bugs backlog -- no active Steps.md for the completed QuickPlan. Review: Context/Reviews/0019-pr112-adapter-test-coverage-2026-04-15.md
- Add adapter-utils.test.ts: unit tests for camelizeKeys (7 cases including digit-adjacent regression) and parseJsonOrValue (5 cases including object passthrough and malformed-JSON error) - Fix sessionTemplateRow and templateActivityRow JSONB fixtures to use pre-parsed objects instead of JSON.stringify, exercising parseJsonOrValue object-passthrough branch (P17-009) - Add supports1RM assertion to getExercises happy-path test (P17-010) - Add mapScheduledSession malformed-JSON fallback test asserting overrides falls back to undefined with console.warn logged (P17-008)
- P19-001: split catch in mapScheduledSession -- ZodError -> console.error
(data integrity event), other errors -> console.warn (expected bad input)
- P19-002: replace inline JSON.parse with parseJsonOrValue for overrides JSONB
field, consistent with all other JSONB columns in the adapter
- P19-004: assert session ID (ss-001) appears in warn spy message
- P19-005: wrap malformed-JSON test assertions in try/finally to guarantee
warnSpy.mockRestore() runs even if an assertion throws
- P19-006: use { cause: err } on outer catch rethrow to preserve error chain
Review: Context/Reviews/0019-pr112-adapter-test-coverage-2026-04-15.md
All 6 findings from PR #112 review resolved. P19-003 (overrides happy-path coverage) added as B009 in Bugs backlog -- no active Steps.md for the completed QuickPlan. Review: Context/Reviews/0019-pr112-adapter-test-coverage-2026-04-15.md
Covers the if (r.overrides != null) branch in mapScheduledSession which had no green assertions -- all prior fixtures used overrides: null. - String-parse path: overrides stored as JSON string (Tauri/SQLite) - Object-passthrough path: overrides as pre-parsed object (Supabase PostgREST) Closes B009.
rghamilton3
force-pushed
the
feat/p17-adapter-test-coverage
branch
from
April 16, 2026 00:24
ec5e616 to
7733f97
Compare
rghamilton3
added a commit
that referenced
this pull request
Apr 16, 2026
* feat(workout): F023 exercise completion signal
Adds a per-exercise "done" affordance to the active workout logger. Athletes can
mark any exercise complete regardless of confirmed set count, collapsing it to a
compact summary row (name + set count badge + expand chevron). Completed blocks
can be re-expanded. All trailing pending input rows are discarded on mark-done
and on FINISH WORKOUT. When all exercises are marked done, a persistent banner
above the FINISH WORKOUT button prompts the athlete to finish.
- ExerciseBlock: isDone/onExpandToggle props; collapsed single-row render path;
done affordance guard removed (visible with 0 confirmed sets)
- log.$workoutId: handleMarkDone, handleExpandDone, expandedDoneActivityIds state,
allActivitiesDone memo, all-done banner, setPendingInputs({}) in handleFinish
- Tests: +27 tests covering A-001 through A-008 (2458 total, all passing)
* chore(meta): resolve backlog items for B009, P17, F022
Mark B009 resolved (overrides test coverage added in PR #112), close out
P17-007 through P17-010 as done, and mark the browser notifications idea
resolved (shipped as F022 in commit 926962e).
* fix(review): resolve PR review findings P20
Fixes: allActivitiesDone circuit filter (P20-001), 48px touch targets
on Done/Add set/Remove buttons (P20-004/005), bare catch blocks in
deleteSet/removeActivity/handleUnconfirmSet (P20-006/007), misleading
A-006 test comment (P20-009), dead Add Set stub in test mock (P20-010)
Tasks: S005-T, S006-T, S007-T added for vacuous A-006/A-003 tests and
mixed-modality banner coverage (P20-002/003/008)
Review: Context/Reviews/0020-pr113-f023-exercise-completion-signal-2026-04-16.md
* test(f023): close vacuous A-003/A-006 coverage gaps + S007-T contracts
S005-T: Rewrites A-006 test -- WorkoutPausedBar mock now renders a real
finish button; test verifies mockFinishWorkout called and pending row
gone after handleFinish fires
S006-T: Rewrites A-003 test -- uses Add Set to establish a pending row
before clicking Done, then asserts the row is removed; confirmed sets
unaffected
S007-T: Adds CIRCUIT filter contract (banner shown when all straight-set
activities done, circuit group excluded) and programmed-workout gate
(banner absent when isProgrammedWorkout=true)
2460 tests passing
* chore(f023): mark review verified and S007-T complete
This branch was successfully deployed
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
src/lib/__tests__/adapter-utils.test.tswith 12 unit tests forcamelizeKeys(including digit-adjacent regression documentation) andparseJsonOrValue(including object passthrough and malformed-JSON error)sessionTemplateRowandtemplateActivityRowJSONB fixtures to use pre-parsed objects instead ofJSON.stringify, exercising theparseJsonOrValueobject-passthrough branchsupports1RMassertion to thegetExerciseshappy-path testmapScheduledSessionmalformed-JSON fallback test -- assertsoverridesfalls back toundefinedandconsole.warnfires with[supabase-adapter]prefixAll 2320 tests passing.
Test plan
bun run testgreen locally (2320 tests)