Skip to content

Add tests for GET /api/payouts#3450

Merged
steven-tey merged 3 commits intomainfrom
add-tests-payouts
Feb 10, 2026
Merged

Add tests for GET /api/payouts#3450
steven-tey merged 3 commits intomainfrom
add-tests-payouts

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Feb 10, 2026

Summary by CodeRabbit

  • Tests
    • Added a new integration test suite for the payouts endpoint. Covers listing with limits, filtering by status/partner/tenant, validation of response structure and stringified date fields via a local schema extension, and proper 404 handling for non-existent tenants. No production code or public API signature changes.

@vercel
Copy link
Contributor

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Feb 10, 2026 1:45pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

A new integration test suite for GET /payouts was added, introducing a local extended PayoutResponse schema (stringified dates) and tests for list retrieval with limit, filtering by status/partnerId/tenantId, and 404 handling for a non-existent tenantId. No production code changed.

Changes

Cohort / File(s) Summary
Payout Endpoint Integration Tests
apps/web/tests/payouts/index.test.ts
Adds a new integration test file that defines a local extended PayoutResponse schema accepting stringified date fields; tests retrieving payouts with a limit, filtering by status, partnerId, and tenantId; and asserts 404 for a non-existent tenantId.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped to check the payouts’ thread,
Dates as strings and filters led,
I checked limits, status, partner ID,
Searched tenants and a 404 I did see —
Our burrow’s tests are snug and fed.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding tests for the GET /api/payouts endpoint.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-tests-payouts

No actionable comments were generated in the recent review. 🎉

Tip

We've launched Issue Planner and it is currently in beta. Please try it out and share your feedback on Discord!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/web/tests/payouts/index.test.ts`:
- Around line 40-52: The "filters by status" test currently uses data.some(...)
which only ensures at least one matching item; change the assertion to ensure
the response is non-empty and that all items match the filter by asserting
data.length > 0 and data.every((payout) => payout.status === "processed"); apply
the same pattern to the "partnerId" and "tenantId" filter tests (replace their
data.some(...) checks with data.length > 0 and data.every(...) matching the
respective partnerId/tenantId values) so the tests verify the filter is applied
to every returned item.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@devkiran
Copy link
Collaborator Author

@coderabbitai full review

@devkiran devkiran requested a review from steven-tey February 10, 2026 14:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

✅ Actions performed

Full review triggered.

@steven-tey steven-tey merged commit 6f4b9cd into main Feb 10, 2026
10 checks passed
@steven-tey steven-tey deleted the add-tests-payouts branch February 10, 2026 18:00
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.

2 participants