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
09b54570
Unverified
Commit
09b54570
authored
Aug 24, 2020
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix integration test for recipient
parent
73580de9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
16 deletions
+35
-16
swap.test.ts
cypress/integration/swap.test.ts
+25
-7
index.tsx
src/components/Settings/index.tsx
+3
-2
index.tsx
src/components/Toggle/index.tsx
+7
-7
No files found.
cypress/integration/swap.test.ts
View file @
09b54570
...
@@ -41,14 +41,32 @@ describe('Swap', () => {
...
@@ -41,14 +41,32 @@ describe('Swap', () => {
cy
.
get
(
'
#confirm-swap-or-send
'
).
should
(
'
contain
'
,
'
Confirm Swap
'
)
cy
.
get
(
'
#confirm-swap-or-send
'
).
should
(
'
contain
'
,
'
Confirm Swap
'
)
})
})
it
(
'
add a recipient
'
,
()
=>
{
it
(
'
add a recipient does not exist unless in expert mode
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
click
()
cy
.
get
(
'
#add-recipient-button
'
).
should
(
'
not.exist
'
)
cy
.
get
(
'
#recipient
'
).
should
(
'
exist
'
)
})
})
it
(
'
remove recipient
'
,
()
=>
{
describe
(
'
expert mode
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
click
()
beforeEach
(()
=>
{
cy
.
get
(
'
#remove-recipient-button
'
).
click
()
cy
.
window
().
then
(
win
=>
{
cy
.
get
(
'
#recipient
'
).
should
(
'
not.exist
'
)
cy
.
stub
(
win
,
'
prompt
'
).
returns
(
'
confirm
'
)
})
cy
.
get
(
'
#open-settings-dialog-button
'
).
click
()
cy
.
get
(
'
#toggle-expert-mode-button
'
).
click
()
cy
.
get
(
'
#confirm-expert-mode
'
).
click
()
})
it
(
'
add a recipient is visible
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
should
(
'
be.visible
'
)
})
it
(
'
add a recipient
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
click
()
cy
.
get
(
'
#recipient
'
).
should
(
'
exist
'
)
})
it
(
'
remove recipient
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
click
()
cy
.
get
(
'
#remove-recipient-button
'
).
click
()
cy
.
get
(
'
#recipient
'
).
should
(
'
not.exist
'
)
})
})
})
})
})
src/components/Settings/index.tsx
View file @
09b54570
...
@@ -188,7 +188,7 @@ export default function SettingsTab() {
...
@@ -188,7 +188,7 @@ export default function SettingsTab() {
}
}
}
}
}
}
>
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
id=
"confirm-expert-mode"
>
Turn On Expert Mode
Turn On Expert Mode
</
Text
>
</
Text
>
</
ButtonError
>
</
ButtonError
>
...
@@ -196,7 +196,7 @@ export default function SettingsTab() {
...
@@ -196,7 +196,7 @@ export default function SettingsTab() {
</
AutoColumn
>
</
AutoColumn
>
</
ModalContentWrapper
>
</
ModalContentWrapper
>
</
Modal
>
</
Modal
>
<
StyledMenuButton
onClick=
{
toggle
}
>
<
StyledMenuButton
onClick=
{
toggle
}
id=
"open-settings-dialog-button"
>
<
StyledMenuIcon
/>
<
StyledMenuIcon
/>
{
expertMode
&&
(
{
expertMode
&&
(
<
EmojiWrapper
>
<
EmojiWrapper
>
...
@@ -229,6 +229,7 @@ export default function SettingsTab() {
...
@@ -229,6 +229,7 @@ export default function SettingsTab() {
<
QuestionHelper
text=
"Bypasses confirmation modals and allows high slippage trades. Use at your own risk."
/>
<
QuestionHelper
text=
"Bypasses confirmation modals and allows high slippage trades. Use at your own risk."
/>
</
RowFixed
>
</
RowFixed
>
<
Toggle
<
Toggle
id=
"toggle-expert-mode-button"
isActive=
{
expertMode
}
isActive=
{
expertMode
}
toggle=
{
toggle=
{
expertMode
expertMode
...
...
src/components/Toggle/index.tsx
View file @
09b54570
...
@@ -10,26 +10,26 @@ const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>`
...
@@ -10,26 +10,26 @@ const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>`
font-weight: 400;
font-weight: 400;
`
`
const
StyledToggle
=
styled
.
a
<
{
isActive
?:
boolean
;
activeElement
?:
boolean
}
>
`
const
StyledToggle
=
styled
.
button
<
{
isActive
?:
boolean
;
activeElement
?:
boolean
}
>
`
border-radius: 16px;
border-radius: 16px;
border: 1px solid
${({
theme
,
isActive
})
=>
(
isActive
?
theme
.
primary5
:
theme
.
text4
)}
;
border: 1px solid
${({
theme
,
isActive
})
=>
(
isActive
?
theme
.
primary5
:
theme
.
text4
)}
;
display: flex;
display: flex;
width: fit-content;
width: fit-content;
cursor: pointer;
cursor: pointer;
text-decoration: none;
outline: none;
:hover {
padding: 0;
text-decoration: none;
background-color: transparent;
}
`
`
export
interface
ToggleProps
{
export
interface
ToggleProps
{
id
?:
string
isActive
:
boolean
isActive
:
boolean
toggle
:
()
=>
void
toggle
:
()
=>
void
}
}
export
default
function
Toggle
({
isActive
,
toggle
}:
ToggleProps
)
{
export
default
function
Toggle
({
i
d
,
i
sActive
,
toggle
}:
ToggleProps
)
{
return
(
return
(
<
StyledToggle
i
sActive=
{
isActive
}
target=
"_self"
onClick=
{
toggle
}
>
<
StyledToggle
i
d=
{
id
}
isActive=
{
isActive
}
onClick=
{
toggle
}
>
<
ToggleElement
isActive=
{
isActive
}
isOnSwitch=
{
true
}
>
<
ToggleElement
isActive=
{
isActive
}
isOnSwitch=
{
true
}
>
On
On
</
ToggleElement
>
</
ToggleElement
>
...
...
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