refactor(config): cadence-keyed plan id, add getTierAmount, drop per-tier helcimPlanId
This commit is contained in:
parent
35197c465b
commit
be0e6e7699
3 changed files with 64 additions and 159 deletions
20
tests/server/config/contributions.test.js
Normal file
20
tests/server/config/contributions.test.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { describe, it, expect } from 'vitest'
|
||||
import { getTierAmount } from '../../../server/config/contributions.js'
|
||||
|
||||
describe('getTierAmount', () => {
|
||||
it('returns monthly amount as-is', () => {
|
||||
expect(getTierAmount({ amount: 5 }, 'monthly')).toBe(5)
|
||||
})
|
||||
|
||||
it('returns annual amount as base * 10', () => {
|
||||
expect(getTierAmount({ amount: 5 }, 'annual')).toBe(50)
|
||||
})
|
||||
|
||||
it('returns annual amount for $50 tier', () => {
|
||||
expect(getTierAmount({ amount: 50 }, 'annual')).toBe(500)
|
||||
})
|
||||
|
||||
it('defaults cadence to monthly', () => {
|
||||
expect(getTierAmount({ amount: 15 })).toBe(15)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue