Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

test: cover small-load double-progression deload

Manuelabbd29e30948
diff --git a/frontend/src/lib/progression.test.js b/frontend/src/lib/progression.test.js
index 490181d1f..fbee03b67 100644
--- a/frontend/src/lib/progression.test.js
+++ b/frontend/src/lib/progression.test.js
@@ -409,6 +409,16 @@ describe('double progression', () => {
expect(p.target1RM).toBe(deloadTarget1RM(40, 12))
})
+ it('keeps a 5 kg load and lowers reps when that is closer than a 50% weight cut', () => {
+ const small = { id: LIFT, sets: 3, reps: 8, repsMin: 4, weight: 5, inc: 2.5, prog: 'double' }
+ const target = { sets: 3, reps: 8, weight: 5 }
+ const p = nextPrescription(hist(LIFT, [[5, 6, 6, 6], [5, 6, 6, 6], [5, 6, 6, 6]], target), small)
+ expect(p.kind).toBe('deload')
+ expect(p.weight).toBe(5)
+ expect(p.reps).toBe(4)
+ expect(p.target1RM).toBe(deloadTarget1RM(5, 8))
+ })
+
it('uses half the reps for per-side Epley and returns an even total', () => {
const perSide = { ...cfg, reps: 8, side: true }
const target = { sets: 3, reps: 8, weight: 60, side: true }