Commit 3f05fee
authored
test(api): verify delta_format=absolute shows commit count in monthly SVG (JhaSourav07#1035) (JhaSourav07#1195)
## Description
Added a new route-level test case in app/api/streak/route.test.ts to
verify the ?delta_format=absolute query parameter in the monthly view.
The test mocks the GitHub API response with realistic weekly
contribution data, requests the streak endpoint with
?view=monthly&delta_format=absolute, asserts a 200 OK status, and
explicitly checks the resulting SVG body for the presence of the word
commits to confirm the raw absolute delta string is rendering properly.
Fixes JhaSourav07#1035
## 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="943" height="344" alt="Screenshot 2026-05-29 120057"
src="https://github.com/user-attachments/assets/08295c0f-a553-4aea-a504-a714a7e12f13"
/>
## 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: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
793 | 824 | | |
794 | 825 | | |
795 | 826 | | |
| |||
0 commit comments