Rename paypalLink to paymentLink and allow inline editing
tinyedge/deploy Deployed by TinyEdge
tinyedge/deploy Deployed by TinyEdge
Generalizes the participant link field beyond PayPal and lets users set/update their payment link directly from the balance summary. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,18 +159,18 @@ describe('Pot API', async () => {
|
||||
expect(fetched.expenses).toEqual([])
|
||||
})
|
||||
|
||||
it('syncs a valid PayPal link to a participant and rejects an invalid one', async () => {
|
||||
it('sets a valid payment link on a participant and rejects an invalid one', async () => {
|
||||
const pot = await $fetch('/api/pots', { method: 'POST', body: { name: 'Reunion', currency: 'EUR', creatorName: 'Alice' } })
|
||||
const alice = pot.creator
|
||||
|
||||
const updated = await $fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, {
|
||||
method: 'PATCH',
|
||||
body: { paypalLink: 'https://paypal.me/alice' },
|
||||
body: { paymentLink: 'https://paypal.me/alice' },
|
||||
})
|
||||
expect(updated.paypalLink).toBe('https://paypal.me/alice')
|
||||
expect(updated.paymentLink).toBe('https://paypal.me/alice')
|
||||
|
||||
await expect(
|
||||
$fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, { method: 'PATCH', body: { paypalLink: 'javascript:alert(1)' } }),
|
||||
$fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, { method: 'PATCH', body: { paymentLink: 'javascript:alert(1)' } }),
|
||||
).rejects.toMatchObject({ statusCode: 400 })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user