feat(backend): social-links service tests, DTO validation, e2e coverage, pagination - #1318
Merged
aji70 merged 1 commit intoJun 28, 2026
Merged
Conversation
|
@Dannyswiss1 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.
This PR completes test coverage and adds pagination for the Social Links backend module.
What's Changed
Service Unit Tests - Happy Path - #1055
SocialLinkServiceinbackend/src/social-link/social-link.service.spec.tsDTO Validation Tests - Invalid Input - #1056
CreateSocialLinkDto,UpdateSocialLinkDtoinsocial-link.dto.spec.tsclass-validator+ValidationPipewithwhitelist: trueE2E Test for Primary Endpoint - #1057
test/social-link.e2e-spec.tsforPOST /api/v1/social-linksPagination / Limit Query Support - #1058
GET /api/v1/users/:userId/social-links?page=1&limit=20&sort=createdAtpage,limitmax 50,sort=createdAt|platform,order=asc|desc{ data: SocialLink[], total: number, page: number, limit: number }page=1,limit=20,sort=createdAt,order=descuserId + createdAt; handles empty result sets gracefullyTesting Done
pnpm test social-link.service.spec.ts→ 12 tests pass, covers all service methodspnpm test social-link.dto.spec.ts→ 9 tests pass for invalid inputs, XSS blockedpnpm test:e2e social-link→ full create/read/delete flow passes, auth enforced?limit=100→ capped at 50;?page=5on 10 items → empty array, total correctpnpm lint→ follows repo eslint + module conventionspnpm test→ existing user/profile tests passNotes
Follows repository patterns: NestJS modules, Prisma repo, DTO validation, Jest + supertest. Pagination uses offset-based for simplicity; cursor-based can be added if volume grows. Invalid/disconnected states return 400/403/404 per existing error conventions. API docs updated in Swagger.
Closes #1055
Closes #1056
Closes #1057
Closes #1058