Commit bd96dce
authored
test(utils): add boundary robustness tests for date range formatter (JhaSourav07#1695)
## Description
Fixes JhaSourav07#1574
Added a reusable `formatDateRange` utility with boundary robustness
handling for partial, missing, and invalid year inputs.
### Supported Cases
* Full 4-digit years: `2024`
* Partial 2-digit years: `24` → `2024`
* Partial 1-digit years: `4` → `2024`
* Missing, empty, or invalid inputs fallback safely to the current year
range
### Changes Made
* Added `utils/dateRange.ts`
* Added `utils/dateRange.test.ts`
* Added 13 boundary-condition test cases
* Ensured all existing tests continue to pass successfully
## 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 — utility and test changes only.
## Checklist before requesting a review:
* [x] I have read the `CONTRIBUTING.md` file.
* [x] I have tested these changes locally.
* [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors.
* [x] My commits follow the Conventional Commits format.
* [ ] 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] All tests pass successfully.0 file changed
0 commit comments