Commit 35fb17e
authored
test(calculate): verify weekendRatio is 100 when all contributions are on weekends JhaSourav07#1055 (JhaSourav07#1160)
## Description
Added a new edge-case test in lib/calculate.test.ts for the
calculateWrappedStats function. The test constructs a mock calendar
where all non-zero contributions occur exclusively on a Saturday and
Sunday (2026-05-02 and 2026-05-03), and successfully asserts that the
resulting weekendRatio evaluates to exactly 100.
Fixes JhaSourav07#1055
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Visual Preview
<img width="938" height="372" alt="Screenshot 2026-05-29 103604"
src="https://github.com/user-attachments/assets/be70674a-777a-4b66-a2b4-3479fb71601d"
/>
## Checklist before requesting a review:
[x] I have read the CONTRIBUTING.md file.
[x] I have tested these changes locally
(localhost:3000/api/streak?user=YOUR_USERNAME).
[x] I have run npm run format and npm run lint locally and resolved all
errors (CI will fail otherwise).
[x] My commits follow the Conventional Commits format (e.g.,
feat(themes): ..., fix(calculate): ...).
[ ] I have updated README.md if I added a new theme or URL parameter.
[x] I have starred the repo.
[x] I have made sure that I have only one commit to merge in this PR.
[x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard.
[x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions.1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
512 | 535 | | |
0 commit comments