mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
test(bolt11): getAmount function
This commit is contained in:
parent
82bf36f064
commit
2f49e94e4c
1 changed files with 19 additions and 0 deletions
19
src/utils/bolt11.test.ts
Normal file
19
src/utils/bolt11.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { assertEquals } from '@std/assert';
|
||||||
|
import { getAmount } from '@/utils/bolt11.ts';
|
||||||
|
|
||||||
|
Deno.test('Invoice is invalid', () => {
|
||||||
|
assertEquals(getAmount('hello'), undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
Deno.test('Invoice is undefined', () => {
|
||||||
|
assertEquals(getAmount(undefined), undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
Deno.test('Amount is 200000', () => {
|
||||||
|
assertEquals(
|
||||||
|
getAmount(
|
||||||
|
'lnbc2u1pn8qatypp5dweqaltlry2vgpxxyc0puxnc50335yznevj2g46wrhfm2694lhgqhp576ekte7lhhtsxdk6tfvkpyp8gdk2xccmuccdxwjd0fqdh34wfseqcqzzsxqyz5vqsp5n44zva7xndawg5l2r9d85v0tszwejtfzkc7v90d6c7d3nsdt0qds9qxpqysgqx2v2artsxmnfkpapdm9f5pahjs8etlpe7kcjue2kffhjg3jrtearstjvenr6lxzhpw3es4hpchzzeet7ul88elurfmvr9v94v0655rgpy7m7r5',
|
||||||
|
),
|
||||||
|
'200000',
|
||||||
|
);
|
||||||
|
});
|
||||||
Loading…
Add table
Reference in a new issue