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
c365a5ec
Unverified
Commit
c365a5ec
authored
May 11, 2020
by
Moody Salem
Committed by
GitHub
May 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some integration tests (#743)
parent
ee92df15
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
9 deletions
+71
-9
landing.test.ts
cypress/integration/landing.test.ts
+21
-0
pool.test.ts
cypress/integration/pool.test.ts
+13
-0
send.test.ts
cypress/integration/send.test.ts
+7
-0
swap.test.ts
cypress/integration/swap.test.ts
+10
-0
index.tsx
src/components/AdvancedSettings/index.tsx
+1
-1
index.tsx
src/components/ExchangePage/index.tsx
+5
-1
index.tsx
src/components/NavigationTabs/index.tsx
+6
-1
index.tsx
src/components/NumericalInput/index.tsx
+5
-6
index.tsx
src/components/SearchModal/index.tsx
+1
-0
index.tsx
src/pages/Pool/index.tsx
+2
-0
No files found.
cypress/integration/landing.test.ts
0 → 100644
View file @
c365a5ec
describe
(
'
Landing Page
'
,
()
=>
{
beforeEach
(()
=>
cy
.
visit
(
'
/
'
))
it
(
'
loads exchange page
'
,
()
=>
{
cy
.
get
(
'
#exchangePage
'
)
})
it
(
'
redirects to url /swap
'
,
()
=>
{
cy
.
url
().
should
(
'
include
'
,
'
/swap
'
)
})
it
(
'
allows navigation to send
'
,
()
=>
{
cy
.
get
(
'
#send-navLink
'
).
click
()
cy
.
url
().
should
(
'
include
'
,
'
/send
'
)
})
it
(
'
allows navigation to pool
'
,
()
=>
{
cy
.
get
(
'
#pool-navLink
'
).
click
()
cy
.
url
().
should
(
'
include
'
,
'
/pool
'
)
})
})
cypress/integration/pool.test.ts
0 → 100644
View file @
c365a5ec
describe
(
'
Pool
'
,
()
=>
{
beforeEach
(()
=>
cy
.
visit
(
'
/pool
'
))
it
(
'
can search for a pool
'
,
()
=>
{
cy
.
get
(
'
#join-pool-button
'
).
click
()
cy
.
get
(
'
#token-search-input
'
).
type
(
'
DAI
'
)
})
it
.
skip
(
'
can import a pool
'
,
()
=>
{
cy
.
get
(
'
#join-pool-button
'
).
click
()
cy
.
get
(
'
#import-pool-link
'
).
click
()
// blocked by the grid element in the search box
cy
.
url
().
should
(
'
include
'
,
'
/find
'
)
})
})
cypress/integration/send.test.ts
0 → 100644
View file @
c365a5ec
describe
(
'
Send
'
,
()
=>
{
beforeEach
(()
=>
cy
.
visit
(
'
/send
'
))
it
(
'
can enter an amount into input
'
,
()
=>
{
cy
.
get
(
'
#sending-no-swap-input
'
).
type
(
'
0.001
'
)
})
})
cypress/integration/
no-connec
t.ts
→
cypress/integration/
swap.tes
t.ts
View file @
c365a5ec
describe
(
'
Homepage
'
,
()
=>
{
describe
(
'
Swap
'
,
()
=>
{
beforeEach
(()
=>
cy
.
visit
(
'
/
'
))
beforeEach
(()
=>
cy
.
visit
(
'
/swap
'
))
it
(
'
loads exchange page
'
,
()
=>
{
cy
.
get
(
'
#exchangePage
'
)
})
it
(
'
has url /swap
'
,
()
=>
{
cy
.
url
().
should
(
'
include
'
,
'
/swap
'
)
})
it
(
'
can enter an amount into input
'
,
()
=>
{
it
(
'
can enter an amount into input
'
,
()
=>
{
cy
.
get
(
'
#swapInputField
'
).
type
(
'
0.001
'
)
cy
.
get
(
'
#swapInputField
'
).
type
(
'
0.001
'
)
})
})
...
...
src/components/AdvancedSettings/index.tsx
View file @
c365a5ec
...
@@ -147,7 +147,7 @@ export default function AdvancedSettings({
...
@@ -147,7 +147,7 @@ export default function AdvancedSettings({
parseCustomInput
(
val
)
parseCustomInput
(
val
)
setActiveIndex
(
SLIPPAGE_INDEX
[
4
])
setActiveIndex
(
SLIPPAGE_INDEX
[
4
])
}
}
}
}
place
H
older=
"Custom"
place
h
older=
"Custom"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
setActiveIndex
(
SLIPPAGE_INDEX
[
4
])
setActiveIndex
(
SLIPPAGE_INDEX
[
4
])
if
(
slippageInput
)
{
if
(
slippageInput
)
{
...
...
src/components/ExchangePage/index.tsx
View file @
c365a5ec
...
@@ -997,7 +997,11 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -997,7 +997,11 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
Max
Max
</MaxButton>
</MaxButton>
)}
)}
<StyledNumerical value={formattedAmounts[Field.INPUT]} onUserInput={val => onUserInput(Field.INPUT, val)} />
<StyledNumerical
id="sending-no-swap-input"
value={formattedAmounts[Field.INPUT]}
onUserInput={val => onUserInput(Field.INPUT, val)}
/>
<CurrencyInputPanel
<CurrencyInputPanel
field={Field.INPUT}
field={Field.INPUT}
value={formattedAmounts[Field.INPUT]}
value={formattedAmounts[Field.INPUT]}
...
...
src/components/NavigationTabs/index.tsx
View file @
c365a5ec
...
@@ -142,7 +142,12 @@ function NavigationTabs({ location: { pathname }, history }: RouteComponentProps
...
@@ -142,7 +142,12 @@ function NavigationTabs({ location: { pathname }, history }: RouteComponentProps
)
:
(
)
:
(
<
Tabs
>
<
Tabs
>
{
tabOrder
.
map
(({
path
,
textKey
,
regex
})
=>
(
{
tabOrder
.
map
(({
path
,
textKey
,
regex
})
=>
(
<
StyledNavLink
key=
{
path
}
to=
{
path
}
isActive=
{
(
_
,
{
pathname
})
=>
!!
pathname
.
match
(
regex
)
}
>
<
StyledNavLink
id=
{
`${textKey}-navLink`
}
key=
{
path
}
to=
{
path
}
isActive=
{
(
_
,
{
pathname
})
=>
!!
pathname
.
match
(
regex
)
}
>
{
t
(
textKey
)
}
{
t
(
textKey
)
}
</
StyledNavLink
>
</
StyledNavLink
>
))
}
))
}
...
...
src/components/NumericalInput/index.tsx
View file @
c365a5ec
...
@@ -48,16 +48,15 @@ function escapeRegExp(string: string): string {
...
@@ -48,16 +48,15 @@ function escapeRegExp(string: string): string {
export
const
Input
=
React
.
memo
(
function
InnerInput
({
export
const
Input
=
React
.
memo
(
function
InnerInput
({
value
,
value
,
onUserInput
,
onUserInput
,
place
H
older
,
place
h
older
,
...
rest
...
rest
}:
{
}:
{
value
:
string
|
number
value
:
string
|
number
onUserInput
:
(
string
)
=>
void
onUserInput
:
(
string
)
=>
void
placeHolder
?:
string
error
?:
boolean
fontSize
?:
string
align
?:
'
right
'
|
'
left
'
align
?:
'
right
'
|
'
left
'
id
?:
string
}
&
Omit
<
React
.
HTMLProps
<
HTMLInputElement
>
,
'
ref
'
|
'
onChange
'
|
'
as
'
>
)
{
onClick
?:
()
=>
void
})
{
const
enforcer
=
(
nextUserInput
:
string
)
=>
{
const
enforcer
=
(
nextUserInput
:
string
)
=>
{
if
(
nextUserInput
===
''
||
inputRegex
.
test
(
escapeRegExp
(
nextUserInput
)))
{
if
(
nextUserInput
===
''
||
inputRegex
.
test
(
escapeRegExp
(
nextUserInput
)))
{
onUserInput
(
nextUserInput
)
onUserInput
(
nextUserInput
)
...
@@ -78,7 +77,7 @@ export const Input = React.memo(function InnerInput({
...
@@ -78,7 +77,7 @@ export const Input = React.memo(function InnerInput({
autoCorrect=
"off"
autoCorrect=
"off"
// text-specific options
// text-specific options
type=
"text"
type=
"text"
placeholder=
{
place
H
older
||
'
0.0
'
}
placeholder=
{
place
h
older
||
'
0.0
'
}
minLength=
{
1
}
minLength=
{
1
}
maxLength=
{
79
}
maxLength=
{
79
}
spellCheck=
"false"
spellCheck=
"false"
...
...
src/components/SearchModal/index.tsx
View file @
c365a5ec
...
@@ -596,6 +596,7 @@ function SearchModal({
...
@@ -596,6 +596,7 @@ function SearchModal({
</
RowBetween
>
</
RowBetween
>
<
Input
<
Input
type=
{
'
text
'
}
type=
{
'
text
'
}
id=
"token-search-input"
placeholder=
{
t
(
'
tokenSearchPlaceholder
'
)
}
placeholder=
{
t
(
'
tokenSearchPlaceholder
'
)
}
value=
{
searchQuery
}
value=
{
searchQuery
}
ref=
{
inputRef
}
ref=
{
inputRef
}
...
...
src/pages/Pool/index.tsx
View file @
c365a5ec
...
@@ -64,6 +64,7 @@ function Supply({ history }: RouteComponentProps) {
...
@@ -64,6 +64,7 @@ function Supply({ history }: RouteComponentProps) {
return
(
return
(
<
AutoColumn
gap=
"lg"
justify=
"center"
>
<
AutoColumn
gap=
"lg"
justify=
"center"
>
<
ButtonPrimary
<
ButtonPrimary
id=
"join-pool-button"
padding=
"16px"
padding=
"16px"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
setShowPoolSearch
(
true
)
setShowPoolSearch
(
true
)
...
@@ -95,6 +96,7 @@ function Supply({ history }: RouteComponentProps) {
...
@@ -95,6 +96,7 @@ function Supply({ history }: RouteComponentProps) {
<
Text
textAlign=
"center"
style=
{
{
padding
:
'
.5rem 0 .5rem 0
'
}
}
>
<
Text
textAlign=
"center"
style=
{
{
padding
:
'
.5rem 0 .5rem 0
'
}
}
>
{
filteredExchangeList
?.
length
!==
0
?
`Don't see a pool you joined? `
:
'
Already joined a pool?
'
}{
'
'
}
{
filteredExchangeList
?.
length
!==
0
?
`Don't see a pool you joined? `
:
'
Already joined a pool?
'
}{
'
'
}
<
Link
<
Link
id=
"import-pool-link"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
history
.
push
(
'
/find
'
)
history
.
push
(
'
/find
'
)
}
}
}
}
...
...
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