Skip to content

Add tests for auth, rewards, quizzes, and notifications API modules #536

Closed

Description

@DeFiVC

What

Four API modules have no test coverage:

  • src/lib/api/auth.ts — Challenge request, token verification, refresh, session management
  • src/lib/api/rewards.ts — Token balance fetching, reward claiming, claim history
  • src/lib/api/quizzes.ts — Quiz generation, submission, attempt history
  • src/lib/api/notifications.ts — Notification fetching, read status, mark all read

Why

The auth API is critical path — it handles the entire SEP-10 authentication flow. Rewards and quizzes are core product features. Untested API modules are prone to regression bugs when the backend contract changes.

Scope

  • Add tests for auth.ts: mock API client, test challenge/verify/refresh flows, test session CRUD
  • Add tests for rewards.ts: mock API client, test balance fetching, test claim flow, test history pagination
  • Add tests for quizzes.ts: mock API client, test quiz generation, submission, attempt retrieval
  • Add tests for notifications.ts: mock API client, test fetch, read status, mark all read
  • Follow existing patterns from src/lib/api/courses.test.ts

Acceptance Criteria

  • Each API module has a corresponding test file
  • All exported functions are tested
  • Success and error paths are covered
  • Tests mock the API client (no real HTTP calls)
  • npm test passes

Technical Context

  • Files: src/lib/api/auth.ts, rewards.ts, quizzes.ts, notifications.ts
  • Reference: src/lib/api/courses.test.ts — existing API test patterns
  • Client: src/lib/api/client.ts — the HTTP client to mock

Activity

  1. added
    enhancementNew feature or request
    testsTest additions or improvements
    highSignificant functionality broken, no workaround, affects multiple users
    on Oct 14, 2026
  2. ranjeetprabhatedu-dotcom commented on Oct 14, 2026

    @ranjeetprabhatedu-dotcom

    Hello maintainers,

    I reviewed "Add tests for auth, rewards, quizzes, and notifications API modules" and would like to work on this.

    Technical Implementation Outline:

    1. Investigate workflow execution logs, environment secrets, and failure exit triggers.
    2. Fix pipeline step sequencing, runner/container configuration, and build artifact caching.
    3. Perform local validation of CI/CD configuration to confirm deterministic behavior.
    4. Ensure automated pipeline triggers and deployment workflows run 100% green without failures.

    Please assign this issue to me. I will submit a clean, well-tested, and production-ready PR promptly!

  3. The-medias-baby commented on Oct 21, 2026

    @The-medias-baby

    @The-medias-baby has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi Maintainer,
    I’m interested in working on this issue and have experience fixing similar problems. I’d be happy to contribute.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @The-medias-baby to this issue.

  4. osasfaith commented on Oct 22, 2026

    @osasfaith
    Contributor

    @osasfaith has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would love to work on this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @osasfaith to this issue.

  5. drips-wave commented on Oct 22, 2026

    @drips-wave

    Congratulations, @osasfaith! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @osasfaith: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. added a commit that references this issue on Oct 23, 2026
    1520d3c
  7. grantfox-oss commented on Oct 23, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @osasfaith's PR #670 was approved and merged by @DeFiVC.

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

    👏 Great work, @osasfaith! Keep contributing to ChainLearnOfficial.

  8. drips-wave commented on Oct 23, 2026

    @drips-wave

    This issue has been completed by @osasfaith as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @osasfaith: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requesthighSignificant functionality broken, no workaround, affects multiple userstestsTest additions or improvements

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions