Skip to content

Commit

Permalink
fix: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Aug 1, 2023
1 parent 270f6a9 commit 2e38478
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/utils/__tests__/transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,20 @@ describe('transactions', () => {
'{"url":"https://test.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"Tes"}',
)
})

it('should only limit the URL to 200 characters', () => {
const app = {
url: 'https://test.com/' + 'a'.repeat(180),
name: 'Test name',
} as SafeAppData

const result = getTxOrigin(app)

expect(result?.length).toBe(200)

expect(result).toBe(
'{"url":"https://test.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":""}',
)
})
})
})

0 comments on commit 2e38478

Please sign in to comment.