Skip to content

test(api-notify-route): Add responsive tests for multi-device columns and mobile viewports#8102

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/apinotifyroute-responsive-breakpoints
Jul 17, 2026
Merged

test(api-notify-route): Add responsive tests for multi-device columns and mobile viewports#8102
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
soumyasekharshee265-ux:test/apinotifyroute-responsive-breakpoints

Conversation

@soumyasekharshee265-ux

Copy link
Copy Markdown
Contributor

Description

Fixes #6769

This PR adds a new isolated test file app/api/notify/route.responsive-breakpoints.test.ts that verifies the /api/notify route behaves consistently across responsive multi-device columns and mobile viewport layouts (~375px wide clients).

The tests validate that:

  • Mobile-width clients (iPhone Safari, Android Chrome, small Android) receive the same JSON shape as desktop clients.
  • Response payload keys reflow into a stable, predictable vertical structure so mobile UI clients can render them in a single-column flex layout.
  • Response fields do not include absolute-width values (e.g. raw long emails) that would cause horizontal scroll on 375px viewports — emails are always masked.
  • All HTTP methods (GET, POST, DELETE) scale down gracefully and return well-formed JSON, never HTML or unstyled error pages.
  • Mobile-specific toggle states (notifyOnCommit, notifyOnStreak, notifyOnMilestone) respond as strict booleans, not coerced strings.

All 6 new tests pass locally and no existing tests were affected.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs) — Testing (new isolated unit + integration tests)

Visual Preview

Not applicable — this PR only adds a backend API test file. No UI or SVG changes.

Test run output:

✓ app/api/notify/route.responsive-breakpoints.test.ts (6 tests) 14ms
✓ /api/notify - responsive breakpoints & mobile viewport layouts (6)
✓ mobile (iPhone 375px) user-agent produces a JSON response with the same shape as desktop
✓ response payload keys reflow into standard vertical structure on mobile clients
✓ response does not include absolute-width values that would cause horizontal scroll on 375px viewports
✓ all HTTP methods scale down gracefully for mobile viewport requests
✓ mobile toggle states (notifyOnCommit/Streak/Milestone booleans) respond cleanly
✓ DELETE handler responds cleanly to mobile viewport request

Test Files 1 passed (1)
Tests 6 passed (6)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (all 6 tests pass via npm run test -- app/api/notify/route.responsive-breakpoints.test.ts).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • I have run npm run test and all tests related to this file pass locally (2 pre-existing failures in app/api/streak/route.timezone-boundaries.test.ts are unrelated to this PR and also fail on main).
  • I have run npm run test:coverage and branch coverage for app/api/notify/route.ts improves (new tests only add coverage — they never remove).
  • My commits follow the Conventional Commits format (test(api-notify-route): verify responsive multi-device columns and mobile viewport layouts).
  • I have updated README.md if I added a new theme or URL parameter. — N/A (no new theme or URL param).
  • 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. — N/A (backend test file, no SVG changes).
  • (Recommended) I joined the CommitPulse Discord server for faster collaboration, mentorship, and PR support.

@retenta-bot

retenta-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This PR adds essential tests to verify the responsiveness of the /api/notify route across different devices, which is crucial for maintaining a good user experience on mobile. Similar past decisions have focused on enhancing test coverage for responsive layouts, ensuring that components behave correctly on smaller screens. It's great to see this commitment to quality! Looking forward to your review. 😊

@retenta-bot retenta-bot Bot changed the title test(api-notify-route): verify responsive multi-device columns and mo… test(api-notify-route): Add responsive tests for multi-device columns and mobile viewports Jul 16, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 16, 2026
@soumyasekharshee265-ux

Copy link
Copy Markdown
Contributor Author

Hi maintainers! 👋

The CI failure here is unrelated to my PR. The TypeScript errors are pre-existing:

  • app/generator/components/EditorPanel.type-compiler.test.tsx:8 (missing showArticles, articlesPlatform, articlesUsername)
  • app/generator/components/PreviewPanel.type-compiler.test.tsx:13 (missing hasContent)
  • lib/rss.ts:1 (cannot find module rss-parser)
  • lib/rss.ts:36 (implicit any)

These same errors reproduce on a clean main branch checkout (verified locally by running npx tsc --noEmit on main).

My PR only adds a new test file app/api/notify/route.responsive-breakpoints.test.ts — no changes to any production code, no changes to generator/components/, lib/rss.ts, or the tsconfig. The 6 new tests pass locally and add coverage for mobile viewport handling of the /api/notify route.

Could a maintainer confirm whether these type errors should be fixed in a separate PR? Happy to help if needed.

@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label 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:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. 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.

Great implementation of the responsive tests for the notify API route. Testing the JSON structural stability across viewports ensures mobile clients get reliable payloads. However, the Vercel check is failing. Please resolve the issues and rerun the CI pipeline.

@soumyasekharshee265-ux

Copy link
Copy Markdown
Contributor Author

Hi @Aamod007, thanks for the review! I checked the Checks tab and there's no Vercel check listed — all 5 checks that ran are passing and 1 is skipped. Could you share a screenshot or link to the failing Vercel check? It may not be triggering on PRs from forks. Thanks!

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

Upon re-evaluation, I realized I previously misinterpreted the Vercel deployment failure as an issue with this PR. The Vercel build failure seems unrelated to the changes introduced here, so I will ignore it moving forward. The rest of the PR looks good, so I'm approving it!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jul 17, 2026
@JhaSourav07
JhaSourav07 merged commit a4e004e into JhaSourav07:main Jul 17, 2026
9 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jul 17, 2026
@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! 💻✨

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: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(ApiNotifyRoute-responsive-breakpoints): verify Responsive Multi-device Columns & Mobile Viewport Layouts (Variation 7)

3 participants