🎉 init

This commit is contained in:
anbraten committed 2026-07-01 15:43:18 +02:00
commit 2f492c55be
64 files changed
+11645

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest'
import { isValidPaymentLink } from './paymentLink'
describe('isValidPaymentLink', () => {
it('accepts an https PayPal.me link', () => {
expect(isValidPaymentLink('https://paypal.me/janedoe')).toBe(true)
})
it('accepts an http link', () => {
expect(isValidPaymentLink('http://paypal.me/janedoe')).toBe(true)
})
it('rejects an empty string', () => {
expect(isValidPaymentLink('')).toBe(false)
})
it('rejects a javascript: URI', () => {
expect(isValidPaymentLink('javascript:alert(1)')).toBe(false)
})
it('rejects a value that is not a URL at all', () => {
expect(isValidPaymentLink('not a link')).toBe(false)
})
})