Skip to content

test(backend): add integration coverage for the v2 deployments route Closes #1165 - #1209

Open
Sycosmile wants to merge 1 commit into
StellerCraft:mainfrom
Sycosmile:test/v2-deployments-route-integration-coverage
Open

test(backend): add integration coverage for the v2 deployments route Closes #1165#1209
Sycosmile wants to merge 1 commit into
StellerCraft:mainfrom
Sycosmile:test/v2-deployments-route-integration-coverage

Conversation

@Sycosmile

@Sycosmile Sycosmile commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Adds integration test coverage for GET /api/v2/deployments, the v2 (internal-format) counterpart to the existing v1 deployments route gap.

Closes #1165

What's covered

Internal-format response shape

  • v2 responds with the internal (camelCase) shape directly — id, name, status, createdAt, updatedAt, deploymentUrl, vercelDeploymentId — plus the pagination envelope, with no migration step involved (migrateV2ToInternal is an identity transform, so there's nothing to migrate).
  • Query-parameter validation: invalid filter, invalid sort, non-numeric limit → 400.
  • limit is capped at 100 when a larger value is requested.
  • Optional filter is applied as an additional eq('status', …) clause.
  • Auth guard (401 when unauthenticated) and the 500 path on a Supabase error.

Deprecation-header absence

  • A request with an explicit Accept: application/vnd.craft.v2+json header and a plain unversioned request to the same path both return no deprecation header and api-version: 2.
  • Note: GET /api/v2/deployments is wrapped in withVersion, whose negotiateVersion resolves the API version from the URL path first, before it looks at any header. Since this route already lives at the versioned /api/v2/... path, negotiation always resolves via source: 'path' here — so an explicit versioned header and no header at all are equivalent for this route, and both correctly omit the deprecation warning since v2 isn't flagged deprecated. Documented this in a comment at the top of the test file for future readers.

12/12 tests passing. npm run lint clean on the new file.

Files changed

  • apps/backend/src/app/api/v2/deployments/deployments-v2.integration.test.ts (new)

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Sycosmile Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Engineer Integration Test Coverage for the v2 Deployments Route

1 participant