Commit 6073d17
authored
test(validations): check boundary robustness of date range formatter (Variation 1) (JhaSourav07#1689)
## Description
Added focused unit tests to `lib/validations.test.ts` evaluating the
parsing constraints of the `streakParamsSchema` to fulfill the
**Variation 1** boundary robustness requirements.
## Pillar
- [x] 🛠️ Other (Bug fix, refactoring, docs, tests)
## Implementation Details
- **Partial/Missing Year Parameters:** Added a test case passing a
payload missing an explicit calendar year sequence (`from: '05-12'`,
`to: '05-30'`) to verify that the validation layer parses it safely via
implicit runtime date fallbacks without crashing.
- **Omitted Date Bounds:** Added a validation check confirming that
completely omitted optional date bounds evaluate gracefully to
`undefined`, allowing downstream logic blocks to fall back to default
ranges smoothly.
- **Validation:** Verified locally that all 81 tests pass successfully
inside `lib/validations.test.ts` with zero TypeScript compilation
warnings or linting errors.
Fixes JhaSourav07#1554
## Checklist
- [x] My code follows the code style of this project.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] My changes generate no new warnings.
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] New and existing unit tests pass locally with my changes.1 parent 7af1b4f commit 6073d17
1 file changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
0 commit comments