Skip to content

test(e2e): add notifications flow coverage (#79)#99

Open
Ayomisco wants to merge 1 commit intoTrustUp-app:mainfrom
Ayomisco:feat/e2e-notifications-flow-79
Open

test(e2e): add notifications flow coverage (#79)#99
Ayomisco wants to merge 1 commit intoTrustUp-app:mainfrom
Ayomisco:feat/e2e-notifications-flow-79

Conversation

@Ayomisco
Copy link
Copy Markdown

PR Description

Summary

Closes #79.
Contributes to #68 (E2E Integration Test Coverage Tracker).

This PR adds end-to-end integration test coverage for the Notifications flow, following the project testing structure and module-based E2E organization.

What was added

Covered scenarios

GET /notifications

  • Returns paginated notifications with unread count (200)
  • Returns unauthorized when token is missing (401)
  • Returns validation error for invalid query parameters (400)

PATCH /notifications/read-all

  • Marks all unread notifications as read (200)
  • Verifies update payload and filtering used for DB state change operation

PATCH /notifications/:id/read

  • Marks a single notification as read (200)
  • Returns not found when notification does not exist (404)
  • Returns forbidden when notification belongs to another user (403)
  • Verifies update payload and notification-id targeting for DB state change operation

Validation

Executed:

  • npm run test:e2e -- test/e2e/modules/notifications/notifications.e2e-spec.ts

Result:

  • 1 test suite passed
  • 7 tests passed

Notes

Closes #79.

Copy link
Copy Markdown
Contributor

@Josue19-08 Josue19-08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ayomisco, thank you for your contribution to the project! 🙌

Two things to sort out:

  • Mock-only vs. real database — Issue #79 explicitly requires
    "Use test database for state validation" and "Verify database state changes after marking as read."
    The current suite mocks SupabaseService entirely, so no real DB state is ever verified (e.g., that is_read actually flips to true or that read_at is persisted). Please update the suite to connect to a real test database.

  • Duplicate PR on the same issue — PR #100 also targets issue #79.
    Please coordinate with the maintainer so it's clear which one will move forward before investing more work.

Feel free to reach out with any questions. Thanks again! 🚀

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.

E2E Tests for Notifications Flow

2 participants