test(backend): add integration coverage for the v2 deployments route Closes #1165 - #1209
Open
Sycosmile wants to merge 1 commit into
Open
Conversation
Co-authored-by: Sycosmile <[email protected]>
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
id,name,status,createdAt,updatedAt,deploymentUrl,vercelDeploymentId— plus thepaginationenvelope, with no migration step involved (migrateV2ToInternalis an identity transform, so there's nothing to migrate).filter, invalidsort, non-numericlimit→ 400.limitis capped at 100 when a larger value is requested.filteris applied as an additionaleq('status', …)clause.Deprecation-header absence
Accept: application/vnd.craft.v2+jsonheader and a plain unversioned request to the same path both return nodeprecationheader andapi-version: 2.GET /api/v2/deploymentsis wrapped inwithVersion, whosenegotiateVersionresolves 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 viasource: '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 lintclean on the new file.Files changed
apps/backend/src/app/api/v2/deployments/deployments-v2.integration.test.ts(new)