mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
The Strava writer had eight mocked test files and no test against a database. strava-sync.test.ts runs the real sync behind a fake Strava API at the safeFetch boundary: field mapping, the after= watermark, idempotent re-sync on the (user, source, external id) key, in-place overwrites that keep what only the detail read carries, a cursor that never moves backwards or past a row that failed to write, the paged backfill with its resume point and requeue, token refresh with both rotated tokens stored sealed, and the integration ledger after transient and permanent failures. The sync, the disconnect and the credential routes are covered through the kit. The mocked cases that asserted call counts and mock ordering are removed; the pure retry-after parsing stays a unit test.