Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesGoalsGoals — QA Plan

Goals — QA Plan

1. Create

#ScenarioExpected
1.1Lose-weight goal: target < current weight201; direction='decrease'; startValue=current
1.2Gain-weight goal: target > current201; direction='increase'
1.3Explicit startValue overrideService uses provided value, not snapshot
1.4startValue == targetValue400
1.5Increase goal with start > target400
1.6body_metric without metricType400
1.7exercise_pr without exerciseId400
1.8exercise_pr referencing canonical exerciseAllowed
1.9exercise_pr referencing another org’s exercise404
1.10No prior body_metric → auto-resolve failsstartValueNumeric=null; progress falls back to ratio

2. Progress computation

Unit-tested in goals.progress.unit.spec.ts. QA spot-checks:

#ScenarioExpected
2.1Increase: start=70, target=80, current=7550%
2.2Decrease: start=80, target=72, current=7650%
2.3Increase, current ≥ target100% capped
2.4Decrease, current ≤ target100% capped
2.5No baseline, current=75, target=8075/80 = 93.75%

3. Achievement

#ScenarioExpected
3.1Update goal to a target already crossedStatus flips to achieved, achievedAt set
3.2Record a new body_metric that crosses targetNext read shows achieved
3.3After achievement, target moved higher againGoes back to active (achievedAt cleared) — verify desired behavior with product

4. CRUD permissions

#ScenarioExpected
4.1Member updates own goal200
4.2Member updates another’s403
4.3Coach views member’s goals200
4.4Coach from another org views403

5. Smoke

  • Lose-weight goal renders progress correctly after a new body metric.
  • Decrease goal does NOT auto-achieve at creation.
  • Archive (soft-delete) removes from listings.