Commit a9b3c35
authored
test(api): add schema-level validation test for invalid accent hex color (JhaSourav07#1891)
## Description
Added schema-level validation tests targeting the `?accent=` parameter
under HEX color validation check. The tests verify that passing an
invalid hex value like `#ZZZZZZZ` is correctly rejected with a 400 Bad
Request, and that valid hex colors are accepted.
Changes
- Added a new test suite in `lib/validations.test.ts` targeting accent
HEX color validation
- Added a route-level test in `app/api/streak/route.test.ts` asserting
400 is returned for invalid accent hex
Fixes JhaSourav07#1450
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
Visual Preview
N/A (test-only change)
## Checklist
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally (`npm run test --
lib/validations.test.ts` and `npm run test --
app/api/streak/route.test.ts`).
- [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.,
`test(api): ...`).
- [ ] 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 & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
651 | 657 | | |
652 | 658 | | |
653 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
699 | | - | |
700 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
701 | 718 | | |
702 | 719 | | |
703 | 720 | | |
704 | | - | |
705 | 721 | | |
706 | 722 | | |
707 | 723 | | |
708 | 724 | | |
709 | 725 | | |
710 | 726 | | |
711 | | - | |
712 | 727 | | |
713 | 728 | | |
714 | | - | |
715 | 729 | | |
716 | 730 | | |
717 | 731 | | |
| |||
720 | 734 | | |
721 | 735 | | |
722 | 736 | | |
723 | | - | |
724 | 737 | | |
725 | 738 | | |
726 | 739 | | |
727 | 740 | | |
728 | | - | |
729 | 741 | | |
730 | 742 | | |
731 | | - | |
732 | 743 | | |
733 | 744 | | |
734 | 745 | | |
| |||
0 commit comments