Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jklein24 committed Sep 21, 2024
1 parent 3431b16 commit 364e78b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions uma/test/uma_test.go
Original file line number Diff line number Diff line change
@@ -44,6 +44,13 @@ func TestParse(t *testing.T) {
assert.ObjectsAreEqual(expectedQuery, *query)
}

func TestInvalidUserName(t *testing.T) {
urlString := "https://vasp2.com/.well-known/lnurlp/bob<>%20?signature=signature&nonce=12345&vaspDomain=vasp1.com&umaVersion=1.0&isSubjectToTravelRule=true&timestamp=12345678"
urlObj, _ := url.Parse(urlString)
_, err := uma.ParseLnurlpRequest(*urlObj)
require.Error(t, err)
}

func TestIsUmaQueryValid(t *testing.T) {
urlString := "https://vasp2.com/.well-known/lnurlp/bob?signature=signature&nonce=12345&vaspDomain=vasp1.com&umaVersion=1.0&isSubjectToTravelRule=true&timestamp=12345678"
urlObj, _ := url.Parse(urlString)

0 comments on commit 364e78b

Please sign in to comment.