Commit a1beebc
authored
test(utils): add boundary robustness test for rate limit TTL timers (JhaSourav07#1655)
## Description
Added a sliding window boundary robustness test for
`getSecondsUntilUTCMidnight` in `utils/time.test.ts`. The test verifies
that the utility returns the correct TTL value across a range of times
approaching UTC midnight, ensuring keys expire exactly at the window
limit.
Changes
- Added a new test in `utils/time.test.ts`
- Simulated a sliding window of times approaching UTC midnight
- Verified correct TTL is returned at each boundary point
- Verified the value resets to 86400 exactly at midnight
Fixes JhaSourav07#1551
## 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 --
utils/time.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(utils): ...`).
- [ ] 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.1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
0 commit comments