Skip to content

test(holders): add integration test for empty key holders list endpoint - #677

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abimbolaalabi:fix/issue-662-empty-key-holders-list
Jul 28, 2026
Merged

test(holders): add integration test for empty key holders list endpoint#677
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abimbolaalabi:fix/issue-662-empty-key-holders-list

Conversation

@abimbolaalabi

Copy link
Copy Markdown
Contributor

Overview

This PR adds a database-backed integration test that verifies the GET /api/v1/creators/:id/holders endpoint returns a 200 status with an empty items array when a creator exists but has no key holders, rather than a 404 or error.

Related Issue

Closes #662

Changes

🧪 Integration Test

  • [ADD] src/__tests__/integration/creator-holders-empty-list.test.ts — seeds a creator with no KeyOwnership records and asserts:
    • Response status 200
    • items is an empty array
    • meta.total is 0 and meta.hasMore is false
    • Response shape is consistent with a non-empty holders list response

Verification Results

The controller logic (src/modules/creators/creator-holders.controller.ts) already returns 200 with { items: [], meta: { total: 0, hasMore: false } } when no holders exist — this test simply adds coverage for that code path end-to-end through the database.

Acceptance Criteria Status
Response status 200 for a creator with no holders
items is an empty array
has_more is false
Response shape consistent with a non-empty holders list response

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

@Chucks1093
Chucks1093 merged commit 0f9db1a into accesslayerorg:main Jul 28, 2026
1 check 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.

Add integration test for key holders list endpoint returning an empty array for a creator with no holders

2 participants