Commit 2abf8c9
authored
test(api validation): check query validation boundaries for ?user= parameter (Variation 3) (JhaSourav07#2058)
## Description
Fixes JhaSourav07#1444
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Security / Input Validation Testing)
## Summary of Changes
- Added a query validation boundary unit test under a dedicated layout
block comment to `lib/validations.test.ts`.
- Verified that passing a simulated input string exceeding 39 characters
(`'a'.repeat(40)`) to the `?user=` parameter correctly triggers a schema
validation error containing the expected message: `'cannot exceed 39
characters'`.
- Added a complementary boundary test to confirm that a username at the
exact maximum permissible boundary limit of 39 characters
(`'a'.repeat(39)`) passes validation successfully.
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally using the isolated Vitest
runner.
- [x] My commits follow the Conventional Commits format (`test(api
validation): ...`).1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
0 commit comments