Skip to content

feat: add price alert integration tests - #670

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Stanley-Owoh:add-price-alert-integration-tests-660
Jul 28, 2026
Merged

feat: add price alert integration tests#670
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Stanley-Owoh:add-price-alert-integration-tests-660

Conversation

@Stanley-Owoh

Copy link
Copy Markdown
Contributor

Summary

Adds an integration test confirming that a price alert does not re-trigger after the threshold has already been crossed once.

Changes

  • New test file: src/modules/alerts/__tests__/alert-no-retrigger-after-threshold.integration.test.ts

What the test covers

  1. Creates a price alert with threshold 500 (direction: above)
  2. First price update (400 → 600) crosses the threshold — asserts the delivery webhook is enqueued exactly once
  3. Asserts the alert record is marked as triggered (isActive: false, triggeredAt set)
  4. Second price update (600 → 700) remains above threshold — asserts no additional delivery is enqueued and no additional update is made to the alert record

Acceptance Criteria

  • Delivery job enqueued exactly once on first threshold crossing
  • No second job enqueued on subsequent above-threshold updates
  • Alert record marked triggered after first crossing
  • Alert not re-triggered unless explicitly reset

Closes #660

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Stanley-Owoh 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 94cbd4b 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 price alert not re-triggering after the threshold has already been crossed once

2 participants