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
Show 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,6 +41,23 @@ describe('Swap', () => {
cy
.
get
(
'
#confirm-swap-or-send
'
).
should
(
'
contain
'
,
'
Confirm Swap
'
)
})
it
(
'
add a recipient does not exist unless in expert mode
'
,
()
=>
{
cy
.
get
(
'
#add-recipient-button
'
).
should
(
'
not.exist
'
)
})
describe
(
'
expert mode
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
window
().
then
(
win
=>
{
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
'
)
...
...
@@ -51,4 +68,5 @@ describe('Swap', () => {
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() {
}
}
}
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
id=
"confirm-expert-mode"
>
Turn On Expert Mode
</
Text
>
</
ButtonError
>
...
...
@@ -196,7 +196,7 @@ export default function SettingsTab() {
</
AutoColumn
>
</
ModalContentWrapper
>
</
Modal
>
<
StyledMenuButton
onClick=
{
toggle
}
>
<
StyledMenuButton
onClick=
{
toggle
}
id=
"open-settings-dialog-button"
>
<
StyledMenuIcon
/>
{
expertMode
&&
(
<
EmojiWrapper
>
...
...
@@ -229,6 +229,7 @@ export default function SettingsTab() {
<
QuestionHelper
text=
"Bypasses confirmation modals and allows high slippage trades. Use at your own risk."
/>
</
RowFixed
>
<
Toggle
id=
"toggle-expert-mode-button"
isActive=
{
expertMode
}
toggle=
{
expertMode
...
...
src/components/Toggle/index.tsx
View file @
09b54570
...
...
@@ -10,26 +10,26 @@ const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>`
font-weight: 400;
`
const
StyledToggle
=
styled
.
a
<
{
isActive
?:
boolean
;
activeElement
?:
boolean
}
>
`
const
StyledToggle
=
styled
.
button
<
{
isActive
?:
boolean
;
activeElement
?:
boolean
}
>
`
border-radius: 16px;
border: 1px solid
${({
theme
,
isActive
})
=>
(
isActive
?
theme
.
primary5
:
theme
.
text4
)}
;
display: flex;
width: fit-content;
cursor: pointer;
text-decoration: none;
:hover {
text-decoration: none;
}
outline: none;
padding: 0;
background-color: transparent;
`
export
interface
ToggleProps
{
id
?:
string
isActive
:
boolean
toggle
:
()
=>
void
}
export
default
function
Toggle
({
isActive
,
toggle
}:
ToggleProps
)
{
export
default
function
Toggle
({
i
d
,
i
sActive
,
toggle
}:
ToggleProps
)
{
return
(
<
StyledToggle
i
sActive=
{
isActive
}
target=
"_self"
onClick=
{
toggle
}
>
<
StyledToggle
i
d=
{
id
}
isActive=
{
isActive
}
onClick=
{
toggle
}
>
<
ToggleElement
isActive=
{
isActive
}
isOnSwitch=
{
true
}
>
On
</
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