test(api-github-route): add responsive tests for multi-device columns & mobile viewport layouts#8119
Conversation
…viewport layouts tests
|
This PR adds important tests to ensure that the |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
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.
|
🎉 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.
Keep building! 💻✨ |
Description
Fixes #6764
This PR adds an isolated test file
app/api/github/route.responsive-breakpoints.test.tsthat verifies the/api/githubroute behaves correctly under Responsive Multi-device Columns & Mobile Viewport Layouts conditions.Since
route.tsis 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:
Viewport-Width/Sec-CH-Viewport-Widthhints are set.?refresh=truefrom an Android mobile UA scales gracefully and returns the correctX-Refresh-Status: Freshheader.X-Refresh-Status: CachedandX-Cache-Status: HITheaders.Test results
npm run format— cleannpm run lint— 0 errorsupstream/main— no merge conflictsPillar
Visual Preview
Not applicable — this PR adds backend API tests only and does not touch SVG output or UI components.
Vitest run output:
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run test— full suite passes).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter. — N/A, no new theme or URL parameter added