Skip to content

test(apistreakpngroute): add mock integration tests#7915

Open
imuniqueshiv wants to merge 1 commit into
JhaSourav07:mainfrom
imuniqueshiv:test/apistreakpngroute-mock-integrations
Open

test(apistreakpngroute): add mock integration tests#7915
imuniqueshiv wants to merge 1 commit into
JhaSourav07:mainfrom
imuniqueshiv:test/apistreakpngroute-mock-integrations

Conversation

@imuniqueshiv

Copy link
Copy Markdown
Contributor

Description

Fixes #6791

Adds mock integration tests for app/api/streak/png/route.ts to verify the PNG conversion pipeline while keeping all external dependencies isolated.

What was tested?

  • Verifies requests are delegated to the upstream SVG route.
  • Verifies SVG content returned by the upstream route is passed to Resvg.
  • Verifies Resvg is initialized with the expected rendering configuration.
  • Verifies the complete SVG → PNG conversion pipeline executes successfully.
  • Verifies cache headers from the upstream SVG response are preserved in the PNG response.

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 (test-only change)

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.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3917.41 KB 3917.41 KB 0 B
Total CSS 325.86 KB 325.86 KB 0 B

@Aamod007 Aamod007 added mentor:Aamod007 level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:testing Adding, updating, or fixing tests labels Jul 10, 2026

@Aamod007 Aamod007 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.

Great work on these PNG route integration tests! I reviewed \�pp/api/streak/png/route.mock-integrations.test.ts\ and successfully mocking @resvg/resvg-js\ to assert the rendering pipeline and cache header forwarding is impressive. This ensures the buffer conversion works smoothly without needing actual image rendering in CI. All tests are passing successfully!

Labels assigned:

  • \level:intermediate: Mocking third-party native libraries like
    esvg\ and verifying buffer pipelines requires solid testing knowledge.
  • \quality:clean: Clean \�i.hoisted\ mocks and well-structured tests.
  • \ ype:testing: Purely focused on integration tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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(ApiStreakPngRoute-mock-integrations): verify Asynchronous Service Layer Mocking & Local Cache Stubs (Variation 9)

2 participants