Skip to content

Commit

Permalink
additional unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Defi-Moses committed Dec 14, 2024
1 parent 171720c commit 5fe94c1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/rest-api/src/tests/bridgeRoute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,22 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body[0].callData).toBeNull()
}, 15000)

it('should return bridge quotes without callData when originUserAddress is not provided', async () => {
const response = await request(app).get('/bridge').query({
fromChain: '1',
toChain: '10',
fromToken: USDC.addresses[1],
toToken: USDC.addresses[10],
amount: '1000',
destAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
})

expect(response.status).toBe(200)
expect(Array.isArray(response.body)).toBe(true)
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0].callData).toBeNull()
}, 15000)

it('should return 400 for invalid destAddress', async () => {
const response = await request(app).get('/bridge').query({
fromChain: '1',
Expand Down

0 comments on commit 5fe94c1

Please sign in to comment.