Skip to content

test(public): add regression coverage for public route registration#352

Open
Ridanshi wants to merge 1 commit into
Dev-Card:mainfrom
Ridanshi:fix/public-route-runtime-registration
Open

test(public): add regression coverage for public route registration#352
Ridanshi wants to merge 1 commit into
Dev-Card:mainfrom
Ridanshi:fix/public-route-runtime-registration

Conversation

@Ridanshi
Copy link
Copy Markdown
Contributor

Closes #309

Summary

Adds focused regression coverage for the public profile routes involved in #309 to ensure runtime Fastify route-registration failures do not reappear.

The underlying implementation in apps/backend/src/routes/public.ts is already fixed on latest upstream/main, so this PR intentionally avoids modifying route logic and instead protects against future regressions through targeted test coverage.

Covered routes:

  • GET /api/public/:username
  • GET /api/public/:username/card/:cardId
  • GET /api/public/:username/qr

Tests Added

Added focused regression tests verifying:

  • public profile route returns 200 OK
  • public shared-card route returns 200 OK
  • routes do not trigger runtime Fastify registration errors
  • QR endpoint behavior remains unchanged

Notes

  • No API contract changes
  • No route implementation changes
  • No unrelated refactors
  • Only focused regression coverage added for the already-fixed production issue

Verification

node_modules\.bin\vitest.CMD run src\__tests__\public.test.ts

@Ridanshi
Copy link
Copy Markdown
Contributor Author

PR #352 addresses issue #309 by adding focused regression coverage for the affected public profile routes.

The underlying nested app.get() registration problem is already fixed on latest upstream/main, so this PR intentionally avoids unnecessary route changes and instead protects against regressions through targeted tests.

Covered routes:

  • GET /api/public/:username
  • GET /api/public/:username/card/:cardId
  • GET /api/public/:username/qr

The new tests verify:

  • affected routes return 200 OK
  • runtime Fastify route-registration errors do not reappear
  • QR endpoint behavior remains unchanged

No API contract changes or unrelated refactors were introduced.

@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public profile routes register nested app.get() handlers at request time, causing production 500s

2 participants