Skip to content

test: add integration test for invoice list endpoint status filtering - #212

Open
Stephan-Thomas wants to merge 1 commit into
StellarState:devfrom
Stephan-Thomas:issue-182-invoice-list-filter
Open

test: add integration test for invoice list endpoint status filtering#212
Stephan-Thomas wants to merge 1 commit into
StellarState:devfrom
Stephan-Thomas:issue-182-invoice-list-filter

Conversation

@Stephan-Thomas

Copy link
Copy Markdown

Description

Adds integration test coverage for the invoice list endpoint's optional status filter.

The tests seed invoices across all supported statuses and verify that filtering returns only invoices matching the requested status, while requests without a filter return all invoices. Invalid status values are also verified to return the expected 422 validation error.

Closes #182

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • All GitHub Actions workflows are green on this PR (required for merge)
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
  • No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove the filtering behavior works correctly
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

How to Test

  1. Seed four invoices with the following statuses:
    • draft
    • published
    • funded
    • settled
  2. Request the invoice list with ?status=published and verify only the published invoice is returned.
  3. Request the invoice list with ?status=funded and verify only the funded invoice is returned.
  4. Request the endpoint without a status parameter and verify all four invoices are returned.
  5. Request the endpoint with ?status=invalid and verify it returns 422 with a validation error.

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Additional Notes

The test suite specifically verifies that status filtering does not leak invoices belonging to other statuses and that the endpoint preserves its existing behavior when no filter is provided.

Invalid status values are also covered to ensure request validation rejects unsupported states with HTTP 422.

For Reviewers

Please focus on:

  • Correct filtering for published and funded statuses.
  • Ensuring invoices with other statuses are excluded from filtered responses.
  • Confirming the unfiltered endpoint still returns all seeded invoices.
  • Correct 422 handling for unsupported status values.
  • Test isolation and cleanup.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Stephan-Thomas 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

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 the invoice list endpoint filtering correctly by status

1 participant