Skip to content

refactor(svg): add tests for getSizeScale helper#931

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
deepsikha-dash:refactor-svg-get-size-scale-tests
May 29, 2026
Merged

refactor(svg): add tests for getSizeScale helper#931
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
deepsikha-dash:refactor-svg-get-size-scale-tests

Conversation

@deepsikha-dash
Copy link
Copy Markdown
Contributor

Description

Adds unit tests for the getSizeScale() helper and exports the function for testing.

Fixes #341

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

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.
  • 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 28, 2026

@deepsikha-dash 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 status:blocked This PR is blocked due to a failing CI check. label May 28, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @deepsikha-dash, 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. 💪

@deepsikha-dash deepsikha-dash force-pushed the refactor-svg-get-size-scale-tests branch 2 times, most recently from b1566e1 to ac89a17 Compare May 28, 2026 12:39
@deepsikha-dash deepsikha-dash force-pushed the refactor-svg-get-size-scale-tests branch from a9e6e10 to 1cd298f Compare May 28, 2026 12:54
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label May 28, 2026
@Aamod007 Aamod007 requested a review from Copilot May 28, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request exports the getSizeScale() helper from lib/svg/generator.ts and adds unit tests to prevent regressions in SVG sizing logic (Fixes #341).

Changes:

  • Exported getSizeScale() so it can be imported from tests.
  • Added a getSizeScale test suite covering undefined, small, medium, and large inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lib/svg/generator.ts Exports getSizeScale; also modifies truncateUsername implementation (currently an unrelated behavior change).
lib/svg/generator.test.ts Adds unit tests for getSizeScale (and introduces a duplicate import that should be consolidated).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/svg/generator.ts
Comment thread lib/svg/generator.ts
Comment thread lib/svg/generator.test.ts Outdated
@github-actions github-actions Bot added type:refactor Code changes that neither fix a bug nor add a feature needs-rebase This PR has merge conflicts and needs a rebase. labels May 28, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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. 🙌

8 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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. 🙌

@deepsikha-dash deepsikha-dash force-pushed the refactor-svg-get-size-scale-tests branch from 4be0df3 to 1cd298f Compare May 29, 2026 04:13
@github-actions
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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 @deepsikha-dash, 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. 🙌

@Aamod007 Aamod007 self-requested a review May 29, 2026 06:07
@github-actions
Copy link
Copy Markdown

⚠️ Hey @deepsikha-dash, 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 the status:blocked This PR is blocked due to a failing CI check. label May 29, 2026
@deepsikha-dash deepsikha-dash force-pushed the refactor-svg-get-size-scale-tests branch from 35ed420 to 07dcf5f Compare May 29, 2026 11:40
@github-actions github-actions Bot removed status:blocked This PR is blocked due to a failing CI check. needs-rebase This PR has merge conflicts and needs a rebase. labels May 29, 2026
@JhaSourav07 JhaSourav07 merged commit b7d6acd into JhaSourav07:main May 29, 2026
3 of 4 checks passed
@JhaSourav07 JhaSourav07 added GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. labels May 29, 2026
@github-actions
Copy link
Copy Markdown

🎉 Congratulations @deepsikha-dash! 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 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points mentor:Aamod007 labels May 29, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 29, 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 GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:refactor Code changes that neither fix a bug nor add a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(svg): add tests for getSizeScale() helper

4 participants