Commit 2a6798f
authored
test(api-validation): add query validation boundaries for ?accent= parameter(Variation 5) (JhaSourav07#2121)
## Description
Adds validation coverage for the `accent` query parameter.
### Changes
- Added schema-level test for invalid HEX color syntax (`#ZZZZZZ`)
- Added endpoint test to verify invalid accent values return HTTP 400
- Ensures malformed color inputs are rejected before reaching core logic
### Testing
- All test suites pass
- Streak endpoint validation verified
Fixes JhaSourav07#1466
## 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="1148" height="512" alt="image"
src="https://github.com/user-attachments/assets/cb6e4cb2-ffd8-43ff-893a-dda6ea5f1a8d"
/>
<img width="1595" height="367" alt="image"
src="https://github.com/user-attachments/assets/cf700628-db99-40f7-ada4-9556877a69fd"
/>
## 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): ...`).
- [x] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have started 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 (no raw elements, smooth animations, correct fonts).
- [ ] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
783 | 793 | | |
784 | 794 | | |
785 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
817 | 833 | | |
818 | 834 | | |
819 | 835 | | |
| |||
0 commit comments