Skip to content

fix(tests): rewrite fake accessibility tests to test real generateOpt…#5381

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
taniy8:fix/svg-renderer-accessibility-tests
Jun 12, 2026
Merged

fix(tests): rewrite fake accessibility tests to test real generateOpt…#5381
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
taniy8:fix/svg-renderer-accessibility-tests

Conversation

@taniy8

@taniy8 taniy8 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #5378

The accessibility test file src/utils/svgRenderer.accessibility.test.ts
was testing a hardcoded HTML string inside beforeEach instead of calling
the real generateOptimizedSvg function. All 5 tests always passed regardless
of what the actual function output, giving false confidence.

Changes

  • Rewrote svgRenderer.accessibility.test.ts to import and call the real
    generateOptimizedSvg function and assert against its actual output
  • Added role="img", aria-labelledby, <title>, and <desc> to
    generateOptimizedSvg in svgRenderer.ts so the real tests pass
  • Updated snapshot in svgRenderer.test.ts.snap to reflect the new
    accessible SVG structure

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

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@Aamod-Dev Aamod-Dev added GSSoc26 GSSoC 2026 level:advanced Complex contributions involving architecture, optimization, or significant feature work 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 type:accessibility Accessibility (a11y) improvements and screen reader fixes mentor:Aamod007 and removed GSSoc26 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 contribution. I went through the changes and the overall approach looks good.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 12, 2026
@JhaSourav07 JhaSourav07 merged commit c57eabc into JhaSourav07:main Jun 12, 2026
13 of 14 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @taniy8! 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! 💻✨

@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 12, 2026
@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 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:accessibility Accessibility (a11y) improvements and screen reader fixes 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.

fix(tests): svgRenderer accessibility tests never call the real function

3 participants