Skip to content

Feat/social links controller unit tests#1336

Merged
aji70 merged 2 commits into
MyFanss:mainfrom
marvs8:feat/social-links-controller-unit-tests
Jun 30, 2026
Merged

Feat/social links controller unit tests#1336
aji70 merged 2 commits into
MyFanss:mainfrom
marvs8:feat/social-links-controller-unit-tests

Conversation

@marvs8

@marvs8 marvs8 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

Test Plan

Automated tests added or updated

  • Unit tests (backend/src/**/*.spec.ts) — service/guard/decorator logic in isolation
  • Integration / e2e tests (backend/test/**/*.e2e-spec.ts) — HTTP round-trips with mocked infrastructure
  • Frontend component tests (frontend/src/**/*.test.{ts,tsx}) — React component behaviour
  • Frontend e2e tests (frontend/e2e/**/*.spec.ts) — Playwright browser flows
  • Contract tests (contract/) — Soroban/Rust unit tests via cargo test
  • No new tests required — explain why: ___

How to run the tests locally

# Backend unit tests
cd backend && npm test

# Backend e2e tests (requires no live DB — uses in-memory mocks)
cd backend && npm run test:e2e

# Frontend component tests
cd frontend && npx vitest run

# Frontend e2e tests (requires dev server on :3000 and API on :3001)
cd frontend && npx playwright test

# Contract tests
cd contract && cargo test

Manual verification checklist

  • Happy path works end-to-end in a local environment
  • Error / edge cases handled gracefully (stale state, invalid input, disconnected wallet)
  • No regressions in closely related API or UI flows
  • Rate-limiting, auth guards, and feature flags behave as expected where touched
  • Linting passes: cd backend && npm run lint / cd frontend && npm run lint

Related issues

Notes for reviewers

closes #1054

Rewrites social-links.controller.spec.ts from 7 thin smoke tests to 36
focused unit tests covering the full SocialLinkController surface.

New coverage added (all service calls are mocked):
- guard & throttle metadata: ThrottlerGuard on class, limit/ttl on create
  and update, verified absence of @Throttle on the read-only list endpoint
- Swagger metadata: @apitags on class, @apioperation on every handler,
  @apiresponse(200) on list and @apiresponse(404) on update
- list: return value pass-through, single service call, exact arg
  forwarding, error propagation
- create: happy path, all fields, partial dto, null-clear, return value
  pass-through, BadRequestException and generic Error propagation
- update: happy path, uuid id forwarding, partial update, null-clear,
  return value pass-through, BadRequestException, NotFoundException, and
  generic Error propagation
- service isolation: each endpoint only calls its own service method

Closes MyFanss#1054

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@marvs8 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

@aji70 aji70 merged commit 6cfca85 into MyFanss:main Jun 30, 2026
2 of 6 checks passed
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.

Backend Social links: Add controller unit tests with mocked service

2 participants