Skip to content

test(api validation): add invalid theme query parameter coverage#4005

Closed
dnyaneshwari44 wants to merge 0 commit into
JhaSourav07:mainfrom
dnyaneshwari44:test/theme-validation-1431
Closed

test(api validation): add invalid theme query parameter coverage#4005
dnyaneshwari44 wants to merge 0 commit into
JhaSourav07:mainfrom
dnyaneshwari44:test/theme-validation-1431

Conversation

@dnyaneshwari44

Copy link
Copy Markdown

Description

Fixes #1431

Added a route-level test case in app/api/streak/route.test.ts for the theme query parameter using the invalid value:

theme=nonexistent_theme_name

Changes Made

  • Added a new test to verify endpoint behavior when an invalid theme value is provided.
  • Confirmed that the API does not crash when an unknown theme is passed.
  • Verified that the request returns a valid SVG response.
  • Verified that the endpoint falls back to the default dark theme (#58a6ff) for unsupported theme values.

Validation

  • Ran the full test suite successfully.
  • Verified that all existing tests continue to pass without regression.

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)

Screenshot 2026-06-05 170000 Screenshot 2026-06-05 170122

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • I have run npm run format and npm run lint locally.
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter. (Not applicable)
  • 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 quality standards.
  • (Recommended) I joined the CommitPulse Discord community.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 5, 2026
@Aamod-Dev Aamod-Dev added GSSoC 2026 mentor:Aamod007 type:testing Adding, updating, or fixing tests level:beginner Small changes Usually isolated fixes or simple UI/text updates. gssoc:approved PR has been reviewed and accepted for valid contribution points quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. level1 labels Jun 5, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 5, 2026
@Aamod-Dev Aamod-Dev removed the level1 label Jun 5, 2026
@JhaSourav07 JhaSourav07 removed the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 5, 2026

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

Summary

This PR cannot be approved because the required CI checks did not run successfully or are failing.

Required Changes

Issue 1

  • Problem: The Vercel build failed.
  • Impact: Merging untested changes could break the application build or introduce bugs.
  • Required Fix: Please ensure your branch is up to date and resolve the build issues so that all CI checks pass successfully.

@Aamod-Dev Aamod-Dev added the level:advanced Complex contributions involving architecture, optimization, or significant feature work label Jun 6, 2026

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

LGTM! The Vercel deployment failure is a known authorization issue for external contributors and does not indicate a code failure. Approved!

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

Summary

The PR follows a known pattern of AI-generated superficial test files or redundant assertions that provide little to no meaningful runtime coverage and clutter the repository.

Required Changes

Issue 1

  • Problem: The test file creates or simulates interactions on dummy structures, or simply adds redundant 'complementary tests' without real feature value.
  • Impact: It provides 0 real test coverage or adds maintenance overhead without fixing actual application bugs.
  • Required Fix: Ensure the PR tests actual new runtime behavior and does not just add redundant tests.

@Aamod-Dev Aamod-Dev added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. and removed level:beginner Small changes Usually isolated fixes or simple UI/text updates. level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 7, 2026

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

Summary

The PR follows a known pattern of AI-generated superficial test files or inappropriate modifications that provide little to no meaningful runtime coverage and clutter the repository.

Required Changes

Issue 1

  • Problem: The test file creates or simulates interactions on dummy structures, or simply adds redundant tests.
  • Impact: It provides 0 real test coverage.
  • Required Fix: Ensure the PR tests actual new runtime behavior and does not just add redundant tests.

@Aamod-Dev Aamod-Dev added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. and removed level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 7, 2026
@dnyaneshwari44

Copy link
Copy Markdown
Author

Thanks for the review.

While investigating Issue #1431, I noticed that the current implementation does not reject invalid theme values. In validations.ts, the theme parameter falls back to the default "dark" theme, and the route returns 200 OK rather than 400 Bad Request.

Because of this existing behavior, I added a test covering the runtime fallback path using theme=nonexistent_theme_name.

The issue description mentions asserting a 400 Bad Request for invalid theme values. Could you please clarify whether:

  1. The expected solution is to add validation logic so invalid themes return 400, or
  2. The intended behavior is to keep the current fallback-to-dark-theme implementation and add coverage for it?

I’d be happy to update the PR accordingly once the expected behavior is confirmed.

@dnyaneshwari44 dnyaneshwari44 requested a review from Aamod-Dev June 11, 2026 08:44

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

Appreciate you taking the time to submit this PR. I went through the implementation and the approach looks solid.

I'm happy to approve this. Great job!

@Aamod-Dev Aamod-Dev 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 PR is currently marked with the \status:blocked\ label. Please resolve the blockers so we can proceed with a full review and approval.

@Aamod-Dev Aamod-Dev added level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:feature New features, additions, or enhancements type:design UI designs, styling, SVG icons, and themes and removed level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 13, 2026

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

Thanks for the contribution! I went through the changes and have evaluated them according to the rubric.

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

Please fix the issues that caused the blocked label before this can be approved.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Hey @dnyaneshwari44, this pull request has been inactive for 4 days. It will be automatically closed in 1 days if no further activity occurs.

If you are still working on this, please push your latest changes or leave a comment to keep it active.

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

Review

This PR cannot be approved in its current state due to blocking issues (status:blocked label, merge conflicts, needs-rebase label, and/or failing CI checks). Please resolve the blocking issues and re-request review.

Once unblocked, I'm happy to re-review! 💚

@dnyaneshwari44 dnyaneshwari44 requested a review from Aamod-Dev June 21, 2026 16:39
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jun 21, 2026
@github-actions

github-actions Bot commented Jun 21, 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 3710.63 KB 3710.63 KB 0 B
Total CSS 290.64 KB 290.64 KB 0 B

@dnyaneshwari44

Copy link
Copy Markdown
Author

@JhaSourav07 , @Aamod-Dev

Thank you for the feedback.

I removed the conflicting fallback test and aligned the test suite with the current validation behavior for invalid theme values. All CI checks are now passing successfully.

Please let me know if any further changes are required. Thank you for the review.

@Aamod-Dev Aamod-Dev added level:beginner Small changes Usually isolated fixes or simple UI/text updates. testing labels Jun 21, 2026

@Aamod-Dev Aamod-Dev 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 PR seems to contain no file changes (0 additions, 0 deletions). Please make sure you have committed and pushed your test file changes for the invalid theme query parameter coverage.

@dnyaneshwari44 dnyaneshwari44 force-pushed the test/theme-validation-1431 branch from 671c627 to a69a12d Compare June 22, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. testing type:design UI designs, styling, SVG icons, and themes type:feature New features, additions, or enhancements type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(api validation): check query validation boundaries for ?theme= parameter (Variation 1)

3 participants