Skip to content

test : add unit tests for achievement-estimators helper functions #2794

Description

@tmdeveloper007

Summary of What Needs to be Done: Add unit tests for the pure helper functions in src/lib/achievement-estimators.ts: calculateNextTier and calculatePercentage. Both functions are synchronous and have no external dependencies, making them ideal test targets.

Changes that Need to be Made: Create test/achievement-estimators.test.ts (matching vitest.config.ts include pattern). Cover: calculateNextTier with current below first tier, current equal to a tier, current above all tiers (maxed), and empty tiers array. Cover calculatePercentage with current below nextTier, current at nextTier, current above nextTier, and nextTier=null (maxed).

Impact that it would Provide: Improves test coverage on a module that currently has no tests. These are foundational functions used across multiple achievement progress calculations, so regression protection here has high value.

Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.

Metadata

Metadata

Assignees

Labels

gssoc:assignedGSSoC: Issue assigned to a contributor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions