Skip to content

test: core gameplay modules have zero unit coverage (puzzles, streak, quests, progress, categories, users) #664

Closed

Description

@phertyameen

Summary

Test coverage is skewed toward analytics/blockchain/support modules (~25 spec files), while the gameplay core is untested:

Module Providers/services without any spec
puzzles puzzles.service.ts, create-puzzle.provider.ts, getAll-puzzle.provider.ts
streak providers/streaks.service.ts, providers/update-streak.provider.ts
quests daily quest generation/completion providers under quests/providers/
progress progress calculation/submission providers under progress/providers/
categories category providers under categories/providers/
users providers/users.service.ts (only xp-level.service.spec.ts exists)

These services own XP math, streak state transitions, quest rollover, and puzzle retrieval - the logic players experience directly and analytics depends on. Regressions here are invisible until runtime.

Proposal

Start with the highest-risk pure-logic units, following the established mocking style (see score.service.spec.ts and challenge-attempt.service.spec.ts):

  1. streaks.service / update-streak.provider: increment, same-day idempotency, date-boundary rollover.
  2. create-puzzle.provider: DTO-to-entity mapping, difficulty enum handling.
  3. users.service: uniqueness conflicts, findOneById contract used by JWT middleware validation.
  4. Quest generation: deterministic day-key behavior.

Suggested split: one focused PR per module.

Acceptance criteria

  • Each module above has its primary provider/service covered.
  • New specs run in the CI test job.
  • No behavioral changes to production code beyond bugfixes the tests surface.

Activity

  1. Kaylahray commented on Aug 27, 2026

    @Kaylahray
    Contributor

    Hi Maintainer, Please Assign

  2. grantfox-oss commented on Aug 27, 2026

    @grantfox-oss

    🦊 GrantFox — @Kaylahray has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #664)
    2. Your PR will be reviewed by the MindBlockLabs maintainers

    Good luck! Track your progress on GrantFox.

  3. grantfox-oss commented on Aug 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @Kaylahray's PR #671 was approved and merged by @A6dulmalik.

    🏆 @Kaylahray: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (494 total points). Track your full progress on GrantFox.

    👏 Great work, @Kaylahray! Keep contributing to MindBlockLabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions