Skip to content

test(adapters): close P17 adapter test coverage gaps - #112

Merged
rghamilton3 merged 6 commits into
mainfrom
feat/p17-adapter-test-coverage
Apr 16, 2026
Merged

rghamilton3 merged 6 commits into
mainfrom
feat/p17-adapter-test-coverage

Conversation

@rghamilton3

Copy link
Copy Markdown
Contributor

Summary

  • P17-007: New src/lib/__tests__/adapter-utils.test.ts with 12 unit tests for camelizeKeys (including digit-adjacent regression documentation) and parseJsonOrValue (including object passthrough and malformed-JSON error)
  • P17-009: Fixed sessionTemplateRow and templateActivityRow JSONB fixtures to use pre-parsed objects instead of JSON.stringify, exercising the parseJsonOrValue object-passthrough branch
  • P17-010: Added supports1RM assertion to the getExercises happy-path test
  • P17-008: Added mapScheduledSession malformed-JSON fallback test -- asserts overrides falls back to undefined and console.warn fires with [supabase-adapter] prefix

All 2320 tests passing.

Test plan

  • CI passes
  • bun run test green locally (2320 tests)

@vercel

vercel Bot commented Apr 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ardent-forge Ready Ready Preview, Comment Apr 16, 2026 0:24am

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
@rghamilton3
rghamilton3 changed the base branch from develop to main April 16, 2026 00:24
- 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
rghamilton3 force-pushed the feat/p17-adapter-test-coverage branch from ec5e616 to 7733f97 Compare April 16, 2026 00:24
@rghamilton3
rghamilton3 merged commit 6d798f7 into main Apr 16, 2026
4 checks passed
rghamilton3 added a commit that referenced this pull request Apr 16, 2026
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).
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

1 active deployment
Preview — 7733f973 Deployed Apr 16, 2026 by vercel[bot]
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