Skip to content

[Backend] — Test: AchievementsService TOTAL_STAKED achievements trigger at correct thresholds #1160

Description

@Olowodarey

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

  1. total_staked_stroops = '999999' (just below 1M) → TOTAL_STAKED_1M not
    unlocked.
  2. total_staked_stroops = '1000000' (exactly 1M) → TOTAL_STAKED_1M unlocked.
  3. total_staked_stroops = '9999999' (just below 10M) → TOTAL_STAKED_10M not
    unlocked; TOTAL_STAKED_1M already unlocked (mock it).
  4. 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....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions