Skip to content

Add unit tests for AI client #608

Closed

Description

@DeFiVC

What

The AI client (src/modules/quizzes/ai-client.ts) has no unit tests. It communicates with the chainlearn-ai service for quiz generation.

Why

AI integration is critical for quiz generation. The request format, error handling, and fallback behavior should be tested.

Scope

In scope:

  • Unit tests for generateQuizFromAI() — request format, response parsing
  • Tests for timeout handling
  • Tests for error handling and fallback

Out of scope:

  • E2E tests

Acceptance Criteria

  • Test file at tests/unit/quizzes/ai-client.test.ts
  • Tests verify request format
  • Tests verify response parsing
  • Tests verify error handling
  • All tests pass

Technical Context

Source: src/modules/quizzes/ai-client.ts

Activity

  1. LayanGift commented on Oct 20, 2026

    @LayanGift

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

    Hello Maintainer,
    I'd like to work on this one. I'll make the necessary changes, verify the expected behavior, and submit a pull request when complete

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

  2. Cynthiaoma commented on Oct 20, 2026

    @Cynthiaoma

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

    Hello Maintainer, I’m Cynthiaoma, a software engineer with experience in decentralised applications and open-source development. I’m ready to contribute and would appreciate this opportunity.

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

  3. Peaostrel commented on Oct 20, 2026

    @Peaostrel

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

    i can handle this quickly

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

  4. chigozirim007 commented on Oct 20, 2026

    @chigozirim007
    Contributor

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

    Good day maintainer my name is Chigozirim and i am a Fullstack engineer and i would like to work on this issue.

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

  5. drips-wave commented on Oct 20, 2026

    @drips-wave

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

    🧑‍💻 @chigozirim007: 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 27, 2026
    543e4ec
  7. grantfox-oss commented on Oct 28, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @chigozirim007's PR #760 was approved and merged by @DeFiVC.

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

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

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 requestlow

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions