Skip to content

feat(wallets): add integration test for wallet following list endpoint - #775

Open
oluwa1to9-web wants to merge 2 commits into
accesslayerorg:mainfrom
oluwa1to9-web:feature/integration-test-wallet-following-creators
Open

feat(wallets): add integration test for wallet following list endpoint#775
oluwa1to9-web wants to merge 2 commits into
accesslayerorg:mainfrom
oluwa1to9-web:feature/integration-test-wallet-following-creators

Conversation

@oluwa1to9-web

Copy link
Copy Markdown
Contributor

Summary

Adds an integration test for the GET /api/v1/wallets/:address/following endpoint that returns all creators a wallet follows, ordered alphabetically by display name.

Closes #768

Changes

  • prisma/schema/follow.prisma — New WalletCreatorFollow model linking wallets to creator profiles they follow, with unique constraint on (walletAddress, creatorId) and indexes for efficient lookups.
  • prisma/schema/migrations/20260825000000_add_wallet_creator_follows/migration.sql — SQL migration creating the wallet_creator_follows table.
  • src/modules/wallets/wallet-following.schemas.ts — Zod validation schema for the :address parameter (reuses existing StellarAddressSchema).
  • src/modules/wallets/wallet-following.service.ts — Service layer that queries follows by wallet address, fetches linked creator profiles, and sorts them alphabetically by displayName.
  • src/modules/wallets/wallet-following.controllers.ts — Express controller that validates params, calls the service, and returns the response.
  • src/modules/wallets/wallets.routes.ts — Registered the new GET /:address/following route with jwtAuth middleware.

Integration Test

src/modules/wallets/wallet-following.integration.test.ts covers all acceptance criteria:

Acceptance Criteria Test
Creators returned in alphabetical order by display name ✅ Asserts ["Alice", "Mike", "Zara"] order
All followed creators present in the response ✅ Asserts data.length === 3 with correct IDs
Empty array for a wallet with no follows ✅ Asserts data === []
Unauthenticated request returns 401 ✅ Asserts status === 401

Test Setup

The test seeds:

  • 3 creator profiles with display names "Alice", "Zara", "Mike" (inserted in reverse alphabetical order to verify sorting)
  • 1 wallet (A) that follows all 3 creators
  • 1 wallet (B) that follows no one
  • JWT tokens for authenticated requests

All seeded data is cleaned up in afterAll.

Verification

  • tsc --noEmit passes cleanly ✅
  • Integration tests require a running PostgreSQL instance (consistent with all other integration tests in the repo)

Note

The wallet_creator_follows migration needs to be applied to the database. If running locally:

npx prisma migrate deploy

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@oluwa1to9-web 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

Add GET /api/v1/wallets/:address/following endpoint that returns all
creators a wallet follows, ordered alphabetically by display name.

Closes accesslayerorg#768

- Add WalletCreatorFollow Prisma model with migration
- Add controller, service, and Zod validation schema
- Register route with jwtAuth middleware (401 for unauthenticated)
- Integration test verifies alphabetical ordering, completeness,
  empty array for wallets with no follows, and 401 for missing auth
@oluwa1to9-web
oluwa1to9-web force-pushed the feature/integration-test-wallet-following-creators branch 5 times, most recently from 6baa975 to ba8ad53 Compare August 25, 2026 17:10
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.

Add integration test for the following list endpoint returning all creators a wallet follows in alphabetical order

1 participant