Skip to content

test(customerpayment): cover non-finite cpayAmount rejection (#346)#347

Merged
CryptoJones merged 1 commit into
masterfrom
test/customerpayment-infinity-amount
May 19, 2026
Merged

test(customerpayment): cover non-finite cpayAmount rejection (#346)#347
CryptoJones merged 1 commit into
masterfrom
test/customerpayment-infinity-amount

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #346.

Summary

Adds POST + PATCH cases for the .finite() rejection on cpayAmount. Mirrors the existing invoicejob.test.js coverage for injbAmount.

Test plan

  • npm run lint && npm test — 792 passing (was 790).

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

The `cpayAmountField` zod schema applies `.coerce.number().finite()`
— JSON has no literal for Infinity, but `coerce` happily turns the
string "Infinity" into the float, and a DOUBLE column would store it
and poison every downstream sum / aging-bucket calculation. The
existing "accepts negative cpayAmount" test had a comment claiming
the schema "blocks 0 and the infinities" but only the zero case had
an explicit test; the .finite() branch was unpinned.

Add POST + PATCH cases covering Infinity and -Infinity. Mirrors
the existing invoicejob.test.js coverage for the same scenario on
`injbAmount`.

Test count: 790 → 792.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit f7b70b6 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the test/customerpayment-infinity-amount branch May 19, 2026 19:10
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.

test(customerpayment): non-finite cpayAmount rejection is unpinned

1 participant