Skip to content

Conversation

@SamNie2027
Copy link

@SamNie2027 SamNie2027 commented Oct 31, 2025

Description

Donation Controller Unit tests for the POST /api/donations, GET /api/donations/public, and GET /api/donations/stats endpoints
Donation e2e integration tests for the POST /api/donations, GET /api/donations/public, and GET /api/donations/stats endpoints

Testing & Verification

Smoke test to validate test setup

  1. POST /api/donations - successful one-time donation creation
  2. POST /api/donations - successful recurring donation with interval
  3. POST /api/donations - validation errors:
  4. Negative amount returns 400
  5. Invalid email format returns 400
  6. Donation marked recurring without a specified interval returns 400
  7. One-time with interval returns 400
  8. Throws 500 if the database errors
  9. Rejects with missing first name
  10. Rejects with missing last name
  11. Rejects with missing email
  12. Rejects with missing amount
  13. Accepts if isAnonymous is missing
  14. Rejects with missing donationType
  15. Rejects with invalid recurring
  16. Rejects with invalid donationType
  17. GET /api/donations/public - returns only non-anonymous donations
  18. Returns no donations if there are none in the db
  19. Throws if db does
  20. Returns with correct DTO
  21. GET /api/donations/stats - returns correct total and count
  22. Returns correct total and count even with empty db
  23. throws if db throws

Related Issues

Closes #23

@SamNie2027 SamNie2027 changed the title 23 Donation e2e integration testing 23 Donation e2e integration and controller unit testing Nov 10, 2025
@SamNie2027 SamNie2027 self-assigned this Nov 10, 2025
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.

Donation E2E integration testing

4 participants