You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: Add comprehensive tests for user promo operations
This commit introduces a suite of tests for the user-facing promo code functionality, ensuring robustness and correctness.
The new tests cover the following areas:
- Promo Code Activation:
- Verification of activation logic, including success and failure scenarios for common and unique promos.
- Edge cases such as inactive promos, targeting mismatches, and exhausted activation limits (max_count).
- Checks to prevent users who are blocked by the anti-fraud service from activating promos.
- Promo Activation History:
- Tests for the user's promo activation history endpoint.
- Validation of the returned data and its order.
- Pagination functionality (limit and offset).
- Anti-Fraud Service Integration:
- Unit tests for the AntiFraudService to verify its caching behavior and resilience to external service failures.
- Integration tests to confirm that the promo activation process correctly respects the anti-fraud service's verdicts, including delayed updates from the cache.
0 commit comments