Commit ea059a6
authored
test(validation): check query validation boundaries for user max length (JhaSourav07#1887)
## Description
Fixes JhaSourav07#1452
Program: GSSoC 2026
This PR handles the implementation of edge validation boundary unit
tests for the incoming `?user=` query parameters.
Previously, basic existence formatting was evaluated, but precise length
bounds were missing test coverage. This patch checks constraint
robustness against long string payloads.
### Changes Made
* Added 1 specific schema validation boundary test case inside
`lib/validations.test.ts`.
* Mocked a boundary payload passing a username input string length of 40
characters using `'a'.repeat(40)`.
* Asserted that validation handles the error structure and responds
exactly with the boundary constraint message: `'cannot exceed 39
characters'`.
### Why this matters
Secures internal endpoint ingestion routers from parsing massive string
parameters, mitigating resource exploitation vectors or unexpected error
bubble-ups down the call stack during upstream fetching operations.
---
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
---
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally (`npm run test`).
- [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 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 (no raw elements, smooth animations, correct fonts).
- [x] (Recommended) I joined the CommitPulse Discord server for faster
collaboration, mentorship, and PR support.1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
| |||
0 commit comments