Skip to content

test: cover empty webhook list for creators with no registered webhooks (#551)#561

Open
CodingAngel1 wants to merge 1 commit into
accesslayerorg:mainfrom
CodingAngel1:test/webhook-empty-list-551
Open

test: cover empty webhook list for creators with no registered webhooks (#551)#561
CodingAngel1 wants to merge 1 commit into
accesslayerorg:mainfrom
CodingAngel1:test/webhook-empty-list-551

Conversation

@CodingAngel1

@CodingAngel1 CodingAngel1 commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Closes #551

This PR adds an integration test to verify that GET /api/v1/creators/:id/webhooks returns 200 OK with an empty array ([]) when a creator exists but has not registered any webhooks.

The current implementation is already correct. The listWebhooksHandler in src/modules/webhooks/webhook.controllers.ts delegates to webhookService.listWebhooks, which returns an empty array when no matching webhook records are found. This change adds automated test coverage to ensure that behavior remains consistent over time.

Scope

The new integration test:

  • Creates a valid creator (User → StellarWallet → CreatorProfile) without registering any webhooks.

  • Sends an authenticated request to GET /api/v1/creators/:id/webhooks using wallet-signed headers generated from the creator's Stellar keypair.

  • Verifies that the endpoint returns:

    • HTTP 200 OK

    • success: true

    • data: []

Files Changed

File | Description -- | -- src/modules/webhooks/webhook.integration.test.ts | Adds a new integration test covering the "creator with no webhooks" scenario.

Verification

The following checks were executed locally:

docker compose up -d postgres

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/accesslayer
pnpm exec prisma db push --force-reset --skip-generate

pnpm exec prisma generate

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/accesslayer
pnpm jest src/modules/webhooks/webhook.integration.test.ts -t "#551" --runInBand

pnpm exec tsc --noEmit

All commands completed successfully. The new #551 integration test passed, and tsc --noEmit exited without errors.

Risk Assessment

Low risk.

This is a test-only change. No production code or application behavior has been modified.

Out of Scope

This PR does not address existing integration tests that use non-numeric creator IDs (for example, "webhook-test-creator-id"), which may fail the current parseCreatorId validation. Those pre-existing issues are unrelated to this change and will be handled separately.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Fix your pr description

@CodingAngel1

CodingAngel1 commented Jun 29, 2026

Copy link
Copy Markdown
Author

@Chucks1093 The description has been fixed. Please review and merge. Thank you for your patience.

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 webhook list returning empty array when creator has no webhooks

2 participants