-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tests for getAssetAddress (#1957)
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { MAINNET_DEFAULT_TOKEN } from 'data/contracts'; | ||
import getAssetAddress from 'utils/getAssetAddress'; | ||
|
||
test.describe('getAssetAddress', async () => { | ||
test('should return MAINNET_DEFAULT_TOKEN for WMATIC', async () => { | ||
const symbol = 'WMATIC'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual(MAINNET_DEFAULT_TOKEN); | ||
}); | ||
|
||
test("should return '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619' for WETH", async () => { | ||
const symbol = 'WETH'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual('0x7ceb23fd6bc0add59e62ac25578270cff1b9f619'); | ||
}); | ||
|
||
test("should return '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' for USDC", async () => { | ||
const symbol = 'USDC'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual('0x2791bca1f2de4661ed88a30c99a7a9449aa84174'); | ||
}); | ||
|
||
test("should return '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063' for DAI", async () => { | ||
const symbol = 'DAI'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual('0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063'); | ||
}); | ||
|
||
test("should return '0xD838290e877E0188a4A44700463419ED96c16107' for NCT", async () => { | ||
const symbol = 'NCT'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual('0xD838290e877E0188a4A44700463419ED96c16107'); | ||
}); | ||
|
||
test('should return MAINNET_DEFAULT_TOKEN for any other symbol', async () => { | ||
const symbol = 'FOO'; | ||
const result = getAssetAddress(symbol); | ||
await expect(result).toEqual(MAINNET_DEFAULT_TOKEN); | ||
}); | ||
}); |
8cca2ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8cca2ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./apps/web
lenster.xyz
web-lenster.vercel.app
web-git-main-lenster.vercel.app
lenster.vercel.app
8cca2ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
prerender – ./apps/prerender
prerender-git-main-lenster.vercel.app
prerender.lenster.xyz
prerender-lenster.vercel.app