Background
AchievementsService.checkAndUnlockAchievements checks
AchievementType.TOTAL_STAKED_1M (1,000,000 stroops) and TOTAL_STAKED_10M
(10,000,000 stroops). There are no tests for these stake-based achievements
at their exact boundaries.
Goal
Add boundary tests in src/achievements/achievements.service.spec.ts.
Requirements
total_staked_stroops = '999999' (just below 1M) → TOTAL_STAKED_1M not
unlocked.
total_staked_stroops = '1000000' (exactly 1M) → TOTAL_STAKED_1M unlocked.
total_staked_stroops = '9999999' (just below 10M) → TOTAL_STAKED_10M not
unlocked; TOTAL_STAKED_1M already unlocked (mock it).
total_staked_stroops = '10000000' (exactly 10M) → both unlocked (only
TOTAL_STAKED_10M awarded since 1M is pre-existing).
Acceptance criteria
- Achievements triggered at the exact boundary....
Background
AchievementsService.checkAndUnlockAchievementschecksAchievementType.TOTAL_STAKED_1M(1,000,000 stroops) andTOTAL_STAKED_10M(10,000,000 stroops). There are no tests for these stake-based achievements
at their exact boundaries.
Goal
Add boundary tests in
src/achievements/achievements.service.spec.ts.Requirements
total_staked_stroops = '999999'(just below 1M) →TOTAL_STAKED_1Mnotunlocked.
total_staked_stroops = '1000000'(exactly 1M) →TOTAL_STAKED_1Munlocked.total_staked_stroops = '9999999'(just below 10M) →TOTAL_STAKED_10Mnotunlocked;
TOTAL_STAKED_1Malready unlocked (mock it).total_staked_stroops = '10000000'(exactly 10M) → both unlocked (onlyTOTAL_STAKED_10Mawarded since 1M is pre-existing).Acceptance criteria