FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uniswap-interface/src/utils/getExplorerLink.test.ts at main · dappcoder/uniswap-interface · GitHub
dappcoder
/
uniswap-interface
Public
forked from
Uniswap/interface
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
uniswap-interface
/
src
/
utils
/
getExplorerLink.test.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (21 loc) · 1004 Bytes
Breadcrumbs
uniswap-interface
/
src
/
utils
/
getExplorerLink.test.ts
Copy path
File metadata and controls
22 lines (21 loc) · 1004 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import
{
ExplorerDataType
,
getExplorerLink
}
from
'./getExplorerLink'
describe
(
'#getExplorerLink'
,
(
)
=>
{
it
(
'correct for tx'
,
(
)
=>
{
expect
(
getExplorerLink
(
1
,
'abc'
,
ExplorerDataType
.
TRANSACTION
)
)
.
toEqual
(
'https://etherscan.io/tx/abc'
)
}
)
it
(
'correct for token'
,
(
)
=>
{
expect
(
getExplorerLink
(
1
,
'abc'
,
ExplorerDataType
.
TOKEN
)
)
.
toEqual
(
'https://etherscan.io/token/abc'
)
}
)
it
(
'correct for address'
,
(
)
=>
{
expect
(
getExplorerLink
(
1
,
'abc'
,
ExplorerDataType
.
ADDRESS
)
)
.
toEqual
(
'https://etherscan.io/address/abc'
)
}
)
it
(
'unrecognized chain id defaults to mainnet'
,
(
)
=>
{
expect
(
getExplorerLink
(
2
,
'abc'
,
ExplorerDataType
.
ADDRESS
)
)
.
toEqual
(
'https://etherscan.io/address/abc'
)
}
)
it
(
'ropsten'
,
(
)
=>
{
expect
(
getExplorerLink
(
3
,
'abc'
,
ExplorerDataType
.
ADDRESS
)
)
.
toEqual
(
'https://ropsten.etherscan.io/address/abc'
)
}
)
it
(
'enum'
,
(
)
=>
{
expect
(
getExplorerLink
(
4
,
'abc'
,
ExplorerDataType
.
ADDRESS
)
)
.
toEqual
(
'https://rinkeby.etherscan.io/address/abc'
)
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL