refactor(contributions): tighten requiresPayment contract; use findLast
This commit is contained in:
parent
62c606b30a
commit
03eee45cbd
2 changed files with 6 additions and 5 deletions
|
|
@ -26,9 +26,10 @@ describe('requiresPayment', () => {
|
|||
expect(requiresPayment(1)).toBe(true)
|
||||
expect(requiresPayment(15)).toBe(true)
|
||||
})
|
||||
it('coerces string numbers', () => {
|
||||
expect(requiresPayment('15')).toBe(true)
|
||||
expect(requiresPayment('0')).toBe(false)
|
||||
it('returns false for null, undefined, NaN', () => {
|
||||
expect(requiresPayment(null)).toBe(false)
|
||||
expect(requiresPayment(undefined)).toBe(false)
|
||||
expect(requiresPayment(NaN)).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue