Skip to content

E2E Tests for Notifications Flow #79

@Josue19-08

Description

@Josue19-08

🔖 Title

E2E Tests for Notifications Flow


📄 Description

Create end-to-end integration tests for the notifications system including listing, filtering, and marking as read. Use test database for state validation. This issue can be completed independently once issues #60 and #61 are implemented.

Related to: Meta-issue #68


✅ Tasks to complete

  • Test listing all notifications (GET /notifications)
  • Test filtering notifications by unread status
  • Test pagination of notifications
  • Test unread count in response
  • Test marking individual notification as read (PATCH /notifications/:id/read)
  • Test marking all notifications as read (PATCH /notifications/read-all)
  • Test complete flow: trigger events → list → mark read → verify count
  • Test validation errors (non-existent ID, wrong user)
  • Test ownership validation (cannot read other users' notifications)
  • Verify database state changes after marking as read
  • Clean up test data after tests

📚 Documentation/context for AI

(This link never should removed)
https://github.com/TrustUp-app/TrustUp-API/tree/main/docs

Relevant documentation:

Dependencies:


🗒️ Additional notes

Acceptance Criteria:

  • All E2E tests pass
  • Notification filtering works correctly
  • Unread count updates after marking as read
  • Ownership validation prevents unauthorized access
  • Database state is correctly updated
  • Test data is cleaned up

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions