Skip to content

test(utils): add boundary robustness tests for time normalization (#1549)#1927

Open
YerraguntaAjayKumar wants to merge 9 commits into
JhaSourav07:mainfrom
YerraguntaAjayKumar:test-time-normalization-1549
Open

test(utils): add boundary robustness tests for time normalization (#1549)#1927
YerraguntaAjayKumar wants to merge 9 commits into
JhaSourav07:mainfrom
YerraguntaAjayKumar:test-time-normalization-1549

Conversation

@YerraguntaAjayKumar
Copy link
Copy Markdown
Contributor

@YerraguntaAjayKumar YerraguntaAjayKumar commented May 31, 2026

Description

This PR introduces boundary robustness tests for time and date range normalization utilities. Specifically, it ensures correct calculation of seconds until midnight across extreme timezones (e.g., UTC-12, UTC+14) without accidental calendar shifting, and verifies sliding window boundary TTLs. It also adds tests to validate safe fallbacks when partial or omitted date ranges are passed.

Fixes #1549

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

N/A - Back-end test suite additions only.

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • 1 new test block added for this utility function.
  • 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.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 31, 2026

@YerraguntaAjayKumar is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 31, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @YerraguntaAjayKumar, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ Hey @YerraguntaAjayKumar, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot added status:blocked This PR is blocked due to a failing CI check. and removed needs-rebase This PR has merge conflicts and needs a rebase. labels May 31, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @YerraguntaAjayKumar, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label May 31, 2026
@YerraguntaAjayKumar
Copy link
Copy Markdown
Contributor Author

Hey! Just wanted to let you know I've resolved the merge conflicts and fixed the formatting/syntax issues. The CI pipeline is now fully passing and everything is synced up with main. It should be good to go for review whenever you have time. Thank you!

Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds 2 timezone boundary tests for extreme offsets: UTC-12 (10 seconds to midnight) and UTC+12/UTC-14 (full 86400s at local midnight). Also adds Arrange/Act/Assert comments to existing date range validation tests. Clean +46/-0, all tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(utils): check boundary robustness of time normalization (Variation 1)

2 participants