Skip to content

test: add tests for progress dashboard (UserProfile, badges, streak, API)#527

Open
mohityadav8 wants to merge 1 commit into
adeyosemanputra:v3.0.0-prefrom
mohityadav8:v3.0.0-pre
Open

test: add tests for progress dashboard (UserProfile, badges, streak, API)#527
mohityadav8 wants to merge 1 commit into
adeyosemanputra:v3.0.0-prefrom
mohityadav8:v3.0.0-pre

Conversation

@mohityadav8

Copy link
Copy Markdown
Contributor

🧪 Overview

This PR adds comprehensive test coverage for the Progress Dashboard feature.


✅ Tests Added

🧑‍💻 UserProfile Model

  • XP → level calculation
  • XP progress percentage
  • Level boundaries (0, 99, 100, 200, 500, etc.)

🏅 Badge System

  • Badge assignment correctness
  • Badge filtering (unknown keys ignored safely)
  • Badge metadata validation

🔥 Streak Logic (Signals)

  • First login initializes streak
  • Consecutive login increments streak
  • Same-day login does not increment
  • Missing profile is auto-created via signal

📊 Progress API

  • Correct counts:
    • solved
    • in_progress
    • not_started
  • XP and streak returned correctly in response

🎯 Purpose

  • Ensure correctness of progress tracking system
  • Prevent regressions in XP, streak, and badge logic
  • Improve overall test coverage for dashboard-related features

📌 Notes

  • Tests are isolated and do not modify existing logic
  • No production code changes included in this PR
  • All tests pass locally

✅ Status

  • All tests passing
  • Ready for review
Screenshot 2026-04-21 011659

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant