Skip to content

test(api-github-route): add responsive tests for multi-device columns & mobile viewport layouts#8119

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/apigithubroute-responsive-breakpoints
Jul 17, 2026
Merged

test(api-github-route): add responsive tests for multi-device columns & mobile viewport layouts#8119
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/apigithubroute-responsive-breakpoints

Conversation

@soumyasekharshee265-ux

Copy link
Copy Markdown
Contributor

Description

Fixes #6764

This PR adds an isolated test file app/api/github/route.responsive-breakpoints.test.ts that verifies the /api/github route behaves correctly under Responsive Multi-device Columns & Mobile Viewport Layouts conditions.

Since route.ts is a backend API route, "responsive breakpoints" is interpreted as ensuring the API is device-agnostic — returning identical, unclipped, well-structured JSON responses regardless of the client's viewport width, mobile User-Agent, or viewport hint headers. This guarantees mobile clients (iPhone, Android, tablet) never encounter horizontal scrollbars, clipped payloads, or inconsistent header contracts.

What this PR adds

Five focused test cases covering the "Definition of done" checklist:

  1. 375px mobile viewport — asserts a clean 200 JSON response with intact payload (no clipping) when Viewport-Width / Sec-CH-Viewport-Width hints are set.
  2. Mobile User-Agent (iPhone Safari) — verifies the response body contains no absolute-width fields that would force horizontal scrollbars.
  3. Mobile pull-to-refresh gesture — confirms ?refresh=true from an Android mobile UA scales gracefully and returns the correct X-Refresh-Status: Fresh header.
  4. Mobile-specific toggle state (refresh OFF) — asserts cached data is served cleanly with the correct X-Refresh-Status: Cached and X-Cache-Status: HIT headers.
  5. Multi-device breakpoint consistency (320px / 375px / 414px) — proves the API returns identical behavior across small, standard, and large phone breakpoints.

Test results

  • ✅ New test file: 5/5 passing
  • ✅ Full suite: 9725/9725 passing (0 regressions)
  • npm run format — clean
  • npm run lint — 0 errors
  • ✅ Branch coverage remains ≥ 70% (only tests added, no production logic changed)
  • ✅ Single atomic commit following Conventional Commits format
  • ✅ Rebased on latest upstream/main — no merge conflicts

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs) — Testing / Coverage improvement

Visual Preview

Not applicable — this PR adds backend API tests only and does not touch SVG output or UI components.

Vitest run output:

  • ✓ app/api/github/route.responsive-breakpoints.test.ts (5 tests) 33ms
  • ✓ Responsive Multi-device Columns & Mobile Viewport Layouts (Issue test(ApiGithubRoute-responsive-breakpoints): verify Responsive Multi-device Columns & Mobile Viewport Layouts (Variation 7) #6764) (5)
    • ✓ serves a clean 200 JSON response for a 375px mobile viewport request
    • ✓ returns identical payload shape when called from a mobile User-Agent
    • ✓ handles a mobile pull-to-refresh (refresh=true) gesture cleanly
    • ✓ responds with cached status when mobile client leaves refresh toggle OFF
    • ✓ returns consistent behavior across 320px / 375px / 414px mobile breakpoints
  • Test Files: 1 passed (1)
  • Tests: 5 passed (5)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (npm run test — full suite passes).
  • 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. — N/A, no new theme or URL parameter added
  • I have starred 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). — N/A, backend tests only
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@retenta-bot

retenta-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This PR adds important tests to ensure that the /api/github route behaves consistently across different devices and viewport sizes, addressing issue #6764. This approach is similar to previous decisions made for the /api/notify route, where we aimed to ensure mobile clients receive the same structured JSON responses as desktop clients. It's great to see these improvements in testing coverage! Thank you for your contribution!

@retenta-bot retenta-bot Bot changed the title test(api-github-route): add responsive multi-device columns & mobile viewpoint layouts tests test(api-github-route): add responsive tests for multi-device columns & mobile viewport layouts Jul 16, 2026
@github-actions

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 3958.92 KB 3958.92 KB 0 B
Total CSS 327.67 KB 327.67 KB 0 B

@Aamod007 Aamod007 added level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:testing Adding, updating, or fixing tests mentor:Aamod007 labels Jul 17, 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.

This test suite for the /api/github\ route is exceptional. You successfully tackled complex scenarios including testing mobile pull-to-refresh interactions, verifying cached headers (\X-Refresh-Status), and mocking asynchronous
ext/server\ \�fter()\ contexts. Validating the absence of horizontal scrollbar triggers by checking the flat payload structure against multiple mobile User-Agents was executed flawlessly.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jul 17, 2026
@JhaSourav07
JhaSourav07 merged commit 9841831 into JhaSourav07:main Jul 17, 2026
10 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @soumyasekharshee265-ux! 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 Jul 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:advanced Complex contributions involving architecture, optimization, or significant feature work mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ApiGithubRoute-responsive-breakpoints): verify Responsive Multi-device Columns & Mobile Viewport Layouts (Variation 7)

3 participants