Skip to content

test(lang-en): add comprehensive unit tests for English translation labels#3341

Open
kanishka-2007-tech wants to merge 2 commits into
JhaSourav07:mainfrom
kanishka-2007-tech:lang
Open

test(lang-en): add comprehensive unit tests for English translation labels#3341
kanishka-2007-tech wants to merge 2 commits into
JhaSourav07:mainfrom
kanishka-2007-tech:lang

Conversation

@kanishka-2007-tech
Copy link
Copy Markdown
Contributor

@kanishka-2007-tech kanishka-2007-tech commented Jun 3, 2026

Description

Adds a dedicated test suite for English localization labels defined in lib/i18n/badgeLabels.ts.

This ensures the English translation mapping remains stable and prevents regressions in badge rendering and localization behavior.


Changes

Added

  • lib/i18n/languages/en.test.ts

Test Coverage

  1. Verifies the en language key exists in the labels dictionary.
  2. Verifies getLabels('en') returns the expected English translation object.
  3. Verifies all required translation properties are defined and non-empty:
    • CURRENT_STREAK
    • ANNUAL_SYNC_TOTAL
    • PEAK_STREAK
    • COMMITS_THIS_MONTH
    • VS_LAST_MONTH
  4. Verifies the exact English translation values match the source definitions.
  5. Verifies unsupported languages correctly fall back to English translations.

Fixes #2331

Pillar

  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🛠️ Other (Bug fix, refactoring, docs)

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 Jun 3, 2026

@kanishka-2007-tech is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Aamod007 Aamod007 added GSSoC 2026 mentor:Aamod007 type:testing Adding, updating, or fixing tests level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSSoC 2026 level:advanced Complex contributions involving architecture, optimization, or significant feature work 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(lang-en): verify English translation labels

2 participants