Skip to content

\test(dateRange): add empty-fallback test and robust parsing"#5311

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
ShafinNigamana:test/date-range-empty-fallback
Jun 12, 2026
Merged

\test(dateRange): add empty-fallback test and robust parsing"#5311
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
ShafinNigamana:test/date-range-empty-fallback

Conversation

@ShafinNigamana

Copy link
Copy Markdown
Contributor

Description

Adds a robust empty-fallback test suite for utils/dateRange.ts and refactors the formatDateRange function to safely handle missing, null, undefined, empty/whitespace, or invalid year parameters without throwing exceptions or crashing.

Fixes #4306

Pillar

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

Visual Preview

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., test(dateRange): ...).
  • 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.
  • 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.

@Aamod-Dev Aamod-Dev added quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. level:beginner Small changes Usually isolated fixes or simple UI/text updates. labels Jun 12, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good work on this one. I reviewed the diff and it looks ready to go from my side.

The test coverage added here looks comprehensive and well-structured. It definitely improves the reliability of the system.

I've approved the PR. Thanks again!

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution. I've taken a look at the changes and everything seems to align with what we need here.

Looks solid. I'll go ahead and approve.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 12, 2026
@JhaSourav07 JhaSourav07 merged commit a018636 into JhaSourav07:main Jun 12, 2026
7 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @ShafinNigamana! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@Aamod-Dev Aamod-Dev added mentor:Aamod007 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:feature New features, additions, or enhancements type:testing Adding, updating, or fixing tests and removed level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:feature New features, additions, or enhancements labels Jun 12, 2026
@Aamod-Dev

Copy link
Copy Markdown
Collaborator

Review Summary
Removed duplicate category labels (quality:exceptional, ype:feature) to adhere to the strict rule of exactly one label per category (retained quality:clean, ype:testing).

@JhaSourav07 JhaSourav07 added gssoc:approved PR has been reviewed and accepted for valid contribution points and removed gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(dateRange-empty-fallback): verify Edge Cases & Empty/Missing Inputs Verification (Variation 1)

3 participants