Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
614c1524
Unverified
Commit
614c1524
authored
Jul 05, 2023
by
Charles Bachmeier
Committed by
GitHub
Jul 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: tokens with same name brake cypress test (#6890)
* fix: tokens with same name brake cypress test * lowercase
parent
082db213
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
+16
-14
token-details.test.ts
cypress/e2e/token-details.test.ts
+2
-2
token-explore.test.ts
cypress/e2e/token-explore.test.ts
+12
-10
TokenRow.tsx
src/components/Tokens/TokenTable/TokenRow.tsx
+1
-1
TokenRow.test.tsx.snap
...ts/Tokens/TokenTable/__snapshots__/TokenRow.test.tsx.snap
+1
-1
No files found.
cypress/e2e/token-details.test.ts
View file @
614c1524
import
{
SupportedChainId
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
SupportedChainId
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
UNI
}
from
'
../../src/constants/tokens
'
import
{
ARB
,
UNI
}
from
'
../../src/constants/tokens
'
import
{
getTestSelector
}
from
'
../utils
'
import
{
getTestSelector
}
from
'
../utils
'
const
UNI_MAINNET
=
UNI
[
SupportedChainId
.
MAINNET
]
const
UNI_MAINNET
=
UNI
[
SupportedChainId
.
MAINNET
]
...
@@ -149,7 +149,7 @@ describe('Token details', () => {
...
@@ -149,7 +149,7 @@ describe('Token details', () => {
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-option-arbitrum
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-option-arbitrum
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Arbitrum
'
)
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Arbitrum
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-ARB
'
)).
click
()
cy
.
get
(
getTestSelector
(
`token-table-row-
${
ARB
.
address
.
toLowerCase
()}
`
)).
click
()
cy
.
get
(
`#swap-currency-output .token-symbol-container`
).
should
(
'
contain.text
'
,
'
ARB
'
)
cy
.
get
(
`#swap-currency-output .token-symbol-container`
).
should
(
'
contain.text
'
,
'
ARB
'
)
cy
.
get
(
getTestSelector
(
'
open-settings-dialog-button
'
)).
should
(
'
be.disabled
'
)
cy
.
get
(
getTestSelector
(
'
open-settings-dialog-button
'
)).
should
(
'
be.disabled
'
)
cy
.
contains
(
'
Connect to Arbitrum
'
).
should
(
'
exist
'
)
cy
.
contains
(
'
Connect to Arbitrum
'
).
should
(
'
exist
'
)
...
...
cypress/e2e/token-explore.test.ts
View file @
614c1524
...
@@ -10,11 +10,11 @@ describe('Token explore', () => {
...
@@ -10,11 +10,11 @@ describe('Token explore', () => {
cy
.
get
(
getTestSelectorStartsWith
(
'
token-table
'
)).
its
(
'
length
'
).
should
(
'
be.greaterThan
'
,
0
)
cy
.
get
(
getTestSelectorStartsWith
(
'
token-table
'
)).
its
(
'
length
'
).
should
(
'
be.greaterThan
'
,
0
)
// check sorted svg icon is present in volume cell, since tokens are sorted by volume by default
// check sorted svg icon is present in volume cell, since tokens are sorted by volume by default
cy
.
get
(
getTestSelector
(
'
header-row
'
)).
find
(
getTestSelector
(
'
volume-cell
'
)).
find
(
'
svg
'
).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
header-row
'
)).
find
(
getTestSelector
(
'
volume-cell
'
)).
find
(
'
svg
'
).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
find
(
getTestSelector
(
'
name-cell
'
)).
should
(
'
include.text
'
,
'
Ether
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
find
(
getTestSelector
(
'
name-cell
'
)).
should
(
'
include.text
'
,
'
Ether
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
find
(
getTestSelector
(
'
volume-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
find
(
getTestSelector
(
'
volume-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
find
(
getTestSelector
(
'
price-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
find
(
getTestSelector
(
'
price-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
find
(
getTestSelector
(
'
tvl-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
find
(
getTestSelector
(
'
tvl-cell
'
)).
should
(
'
include.text
'
,
'
$
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
))
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
))
.
find
(
getTestSelector
(
'
percent-change-cell
'
))
.
find
(
getTestSelector
(
'
percent-change-cell
'
))
.
should
(
'
include.text
'
,
'
%
'
)
.
should
(
'
include.text
'
,
'
%
'
)
cy
.
get
(
getTestSelector
(
'
header-row
'
)).
find
(
getTestSelector
(
'
price-cell
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
header-row
'
)).
find
(
getTestSelector
(
'
price-cell
'
)).
click
()
...
@@ -24,14 +24,14 @@ describe('Token explore', () => {
...
@@ -24,14 +24,14 @@ describe('Token explore', () => {
it
(
'
should update when time window toggled
'
,
()
=>
{
it
(
'
should update when time window toggled
'
,
()
=>
{
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
get
(
getTestSelector
(
'
time-selector
'
)).
should
(
'
contain
'
,
'
1D
'
)
cy
.
get
(
getTestSelector
(
'
time-selector
'
)).
should
(
'
contain
'
,
'
1D
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
))
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
))
.
find
(
getTestSelector
(
'
volume-cell
'
))
.
find
(
getTestSelector
(
'
volume-cell
'
))
.
then
(
function
(
$elem
)
{
.
then
(
function
(
$elem
)
{
cy
.
wrap
(
$elem
.
text
()).
as
(
'
dailyEthVol
'
)
cy
.
wrap
(
$elem
.
text
()).
as
(
'
dailyEthVol
'
)
})
})
cy
.
get
(
getTestSelector
(
'
time-selector
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
time-selector
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
1Y
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
1Y
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
))
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
))
.
find
(
getTestSelector
(
'
volume-cell
'
))
.
find
(
getTestSelector
(
'
volume-cell
'
))
.
then
(
function
(
$elem
)
{
.
then
(
function
(
$elem
)
{
cy
.
wrap
(
$elem
.
text
()).
as
(
'
yearlyEthVol
'
)
cy
.
wrap
(
$elem
.
text
()).
as
(
'
yearlyEthVol
'
)
...
@@ -41,7 +41,7 @@ describe('Token explore', () => {
...
@@ -41,7 +41,7 @@ describe('Token explore', () => {
it
(
'
should navigate to token detail page when row clicked
'
,
()
=>
{
it
(
'
should navigate to token detail page when row clicked
'
,
()
=>
{
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
token-details-about-section
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-details-about-section
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-details-stats
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-details-stats
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-info-container
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-info-container
'
)).
should
(
'
exist
'
)
...
@@ -53,13 +53,15 @@ describe('Token explore', () => {
...
@@ -53,13 +53,15 @@ describe('Token explore', () => {
it
(
'
should update when global network changed
'
,
()
=>
{
it
(
'
should update when global network changed
'
,
()
=>
{
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
visit
(
'
/tokens/ethereum
'
)
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Ethereum
'
)
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Ethereum
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
ETH
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-
NATIVE
'
)).
should
(
'
exist
'
)
// note: cannot switch global chain via UI because we cannot approve the network switch
// note: cannot switch global chain via UI because we cannot approve the network switch
// in metamask modal using plain cypress. this is a workaround.
// in metamask modal using plain cypress. this is a workaround.
cy
.
visit
(
'
/tokens/polygon
'
)
cy
.
visit
(
'
/tokens/polygon
'
)
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Polygon
'
)
cy
.
get
(
getTestSelector
(
'
tokens-network-filter-selected
'
)).
should
(
'
contain
'
,
'
Polygon
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-MATIC
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
token-table-row-NATIVE
'
))
.
find
(
getTestSelector
(
'
name-cell
'
))
.
should
(
'
include.text
'
,
'
Polygon Matic
'
)
})
})
it
(
'
should update when token explore table network changed
'
,
()
=>
{
it
(
'
should update when token explore table network changed
'
,
()
=>
{
...
...
src/components/Tokens/TokenTable/TokenRow.tsx
View file @
614c1524
...
@@ -458,7 +458,7 @@ export const LoadedRow = forwardRef((props: LoadedRowProps, ref: ForwardedRef<HT
...
@@ -458,7 +458,7 @@ export const LoadedRow = forwardRef((props: LoadedRowProps, ref: ForwardedRef<HT
// TODO: currency logo sizing mobile (32px) vs. desktop (24px)
// TODO: currency logo sizing mobile (32px) vs. desktop (24px)
return
(
return
(
<
div
ref=
{
ref
}
data
-
testid=
{
`token-table-row-${token.
symbol
}`
}
>
<
div
ref=
{
ref
}
data
-
testid=
{
`token-table-row-${token.
address
}`
}
>
<
StyledLink
<
StyledLink
to=
{
getTokenDetailsURL
(
token
)
}
to=
{
getTokenDetailsURL
(
token
)
}
onClick=
{
()
=>
onClick=
{
()
=>
...
...
src/components/Tokens/TokenTable/__snapshots__/TokenRow.test.tsx.snap
View file @
614c1524
...
@@ -327,7 +327,7 @@ exports[`LoadedRow.tsx renders a row 1`] = `
...
@@ -327,7 +327,7 @@ exports[`LoadedRow.tsx renders a row 1`] = `
}
}
<div
<div
data-testid="token-table-row-
USDC
"
data-testid="token-table-row-
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
"
>
>
<a
<a
class="c0"
class="c0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment