Fixes for donation amount picker

This commit is contained in:
ayumi-signal 2025-09-03 10:47:19 -07:00 committed by GitHub
commit 14e0086943
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 286 additions and 39 deletions

View file

@ -129,10 +129,12 @@ describe('toHumanCurrencyString', () => {
{
amount,
currency,
symbol = 'symbol',
showInsignificantFractionDigits = false,
}: {
amount: number;
currency: string;
symbol?: 'symbol' | 'narrowSymbol' | 'none';
showInsignificantFractionDigits?: boolean;
},
expectedOutput: string | undefined
@ -142,6 +144,7 @@ describe('toHumanCurrencyString', () => {
toHumanCurrencyString({
amount: humanAmount,
currency,
symbol,
showInsignificantFractionDigits,
}),
expectedOutput
@ -157,6 +160,12 @@ describe('toHumanCurrencyString', () => {
testFn({ amount: 10.5, currency: 'USD' }, '$10.50');
testFn({ amount: 10.5, currency: 'USD' }, '$10.50');
testFn({ amount: 10.69, currency: 'USD' }, '$10.69');
testFn({ amount: 10.5, currency: 'USD', symbol: 'none' }, '10.50');
});
it('handles CAD', () => {
testFn({ amount: 10, currency: 'CAD' }, 'CA$10');
testFn({ amount: 10, currency: 'CAD', symbol: 'narrowSymbol' }, '$10');
});
it('handles EUR', () => {