test(api-compare): verify dark and light prefers-color-scheme visual cohesion #4431#5746
Conversation
|
@Rakshak05 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
📦 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.
I reviewed the PR title/description, linked issue #4431, checks, and the diff before labeling.
Labels applied:
level:intermediate: the newapp/api/compare/route.theme-contrast.test.tsfile is a fairly large 208-line route test suite covering multiple success and error branches.quality:clean: the test cases are organized by concern and thegetFullDashboardDatamock keeps the route behavior isolated.type:testing: the PR is dedicated test coverage for the compare route.type:design: the assertions are explicitly about theme contrast, style tokens, and client-hint-driven visual cohesion.
I’m leaving this as a neutral comment rather than approving because the repo checks are green but the PR still carries a failing Vercel status context. That looks like a deployment integration/auth issue rather than a code failure.
To unblock it, the Vercel GitHub integration for the repo/team needs to be re-authorized or the status needs to be marked non-blocking by maintainers. Once the Vercel context is green, this can be reviewed normally.
Aamod007
left a comment
There was a problem hiding this comment.
This test file is doing useful work for �pp/api/compare/route.theme-contrast.test.ts. The mocked theme paths, error-status coverage, and payload equality checks give the route a clear guardrail against theme-sensitive regressions.
|
🎉 Congratulations @Rakshak05! 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! 💻✨ |
Closes #4431
Description
This PR introduces isolated unit and integration testing targeting Dark and Light Prefers-Color-Scheme Visual Cohesion for the comparison API route (
app/api/compare/route.ts).Specifically, it creates the new test file
app/api/compare/route.theme-contrast.test.tsimplementing the following 5 test cases:window.matchMediafor both dark and light settings to verify that the JSON response payload carries no hardcoded color tokens (hex values, rgb/rgba, or Tailwind color classes).X-ThemeorX-Color-Scheme) and that Content-Type is strictlyapplication/json, leaving theme styling controls fully to the client.Sec-CH-Prefers-Color-Schemeclient headers to verify that the API returns structurally identical payloads in both modes.Pillar
Visual Preview
N/A (Backend / API Tests)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).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.