Skip to content

test: add unit and integration tests for alerts, airdrops, and webhooks - #222

Merged
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
chinoyenmose:fix/tests-alerts-airdrops-webhooks-158-160
Aug 26, 2026
Merged

test: add unit and integration tests for alerts, airdrops, and webhooks#222
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
chinoyenmose:fix/tests-alerts-airdrops-webhooks-158-160

Conversation

@chinoyenmose

Copy link
Copy Markdown
Contributor

Fixes #158
Fixes #159
Fixes #160

What changed

  • No unit tests for alerts service #158: Added alerts tests for isTriggered edge cases (boundary values, unknown type), create normalization (uppercase asset, default repeat, unique IDs), fire payload verification, and multiple alerts per asset
  • No unit tests for airdrop service #159: Added airdrop tests for cancel preserving recipients, addRecipients with empty input, listRecipients pagination, contract_airdrop_id handling, and cancel on completed airdrop
  • No integration tests for webhook CRUD API #160: Added webhook integration tests for API contract (secret not leaked in GET), default active state, wildcard/multiple event subscriptions, PATCH events and URL updates, and empty deliveries endpoint

Why

  • Alert logic determines when price thresholds are hit — bugs could cause missed or false alerts
  • Airdrop service is core business logic — bugs could cause incorrect token distributions
  • Webhook management is user-facing — API contract bugs affect integrators

How to test

  • Run npx jest test/alerts.test.js test/airdrops-service.test.js test/webhooks.routes.test.js
  • All 103 tests pass across the 3 modified test files

- SmartDropLabs#158: Add alerts tests for isTriggered edge cases, create normalization,
  fire payload verification, and multiple alerts per asset
- SmartDropLabs#159: Add airdrop tests for cancel preserving recipients, addRecipients
  with empty input, listRecipients pagination, and contract_airdrop_id
- SmartDropLabs#160: Add webhook integration tests for API contract, default active
  state, wildcard events, PATCH events/url, and empty deliveries
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

@ritaifeoluwa
ritaifeoluwa merged commit 7c93726 into SmartDropLabs:main Aug 26, 2026
2 of 4 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.

No integration tests for webhook CRUD API No unit tests for airdrop service No unit tests for alerts service

2 participants