Skip to content

\test(time): add empty-fallback test and fix timezone mock"#5309

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

\test(time): add empty-fallback test and fix timezone mock"#5309
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
ShafinNigamana:test/time-empty-fallback

Conversation

@ShafinNigamana

Copy link
Copy Markdown
Contributor

Description

Adds a robust empty-fallback test suite for utils/time.ts, refactors getSecondsUntilMidnightInTimezone to safely default to UTC calculations when timezone inputs are missing, empty, or null/undefined, and corrects a pre-existing construction TypeError in utils/time.massive-scaling.test.ts.

Fixes #4308

Pillar

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

Visual Preview

N/A — Purely a logic / unit testing update. No visual changes.

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • 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.
  • 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.

@ShafinNigamana ShafinNigamana force-pushed the test/time-empty-fallback branch from 38053df to cc38cdd Compare June 11, 2026 20:18
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Hey @ShafinNigamana, 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 added the status:blocked This PR is blocked due to a failing CI check. label Jun 11, 2026
@ShafinNigamana ShafinNigamana force-pushed the test/time-empty-fallback branch 2 times, most recently from c229317 to b1401a3 Compare June 11, 2026 20:34
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jun 11, 2026
@ShafinNigamana ShafinNigamana force-pushed the test/time-empty-fallback branch from b1401a3 to bc80b3b Compare June 11, 2026 20:55
@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.

Thanks for the PR. It looks like a good start, but there are a few areas that could use some refinement to ensure long-term maintainability. Let's get these sorted out.

  • I noticed some leftover debugging statements (e.g., console.log). Let's make sure to clean those up before merging so they don't clutter the production logs.

Looking forward to seeing the revised version. Thanks for your hard work on this.

@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 your contribution. The overall direction looks good, but there are a few issues to address:

  • I noticed some leftover debugging statements (console.log). Please remove them before we can merge this.

Let me know when you've updated the PR!

@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 went through the changes and the overall approach looks good. The fallback logic for missing timezones is well implemented, and the tests clearly cover the edge cases. I'll go ahead and approve this PR. Thanks again for the contribution.

@Aamod-Dev Aamod-Dev added mentor:Aamod007 type:bug Something isn't working as expected type:testing Adding, updating, or fixing tests labels Jun 12, 2026
@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 12, 2026
@JhaSourav07 JhaSourav07 merged commit 9c41c2c into JhaSourav07:main Jun 12, 2026
10 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! 💻✨

@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:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants