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
982c99b0
Unverified
Commit
982c99b0
authored
Dec 14, 2022
by
aballerr
Committed by
GitHub
Dec 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Nft cypress tests 2 (#5658)
* adding in final set of nft cypress tests
parent
484a7d49
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
12 deletions
+64
-12
nfts.test.ts
cypress/e2e/nfts.test.ts
+29
-0
AuthenticatedHeader.tsx
src/components/WalletDropdown/AuthenticatedHeader.tsx
+6
-1
Bag.tsx
src/nft/components/bag/Bag.tsx
+5
-1
BagHeader.tsx
src/nft/components/bag/BagHeader.tsx
+1
-1
EmptyContent.tsx
src/nft/components/bag/EmptyContent.tsx
+3
-1
Card.tsx
src/nft/components/collection/Card.tsx
+1
-1
AssetDetails.tsx
src/nft/components/details/AssetDetails.tsx
+12
-3
AssetPriceDetails.tsx
src/nft/components/details/AssetPriceDetails.tsx
+1
-1
InfoContainer.tsx
src/nft/components/details/InfoContainer.tsx
+2
-1
WelcomeModal.tsx
src/nft/components/explore/WelcomeModal.tsx
+1
-1
EmptyWalletContent.tsx
src/nft/components/profile/view/EmptyWalletContent.tsx
+3
-1
No files found.
cypress/e2e/nfts.test.ts
View file @
982c99b0
...
...
@@ -32,4 +32,33 @@ describe('Testing nfts', () => {
cy
.
get
(
getTestSelector
(
'
nft-activity
'
)).
first
().
click
()
cy
.
get
(
getTestSelector
(
'
nft-activity-row
'
)).
should
(
'
exist
'
)
})
it
(
'
should go to the details page
'
,
()
=>
{
cy
.
visit
(
`/#/nfts/collection/
${
COLLECTION_ADDRESS
}
`
)
cy
.
get
(
getTestSelector
(
'
nft-filter
'
)).
first
().
click
()
cy
.
get
(
getTestSelector
(
'
nft-collection-filter-buy-now
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-details-link
'
)).
first
().
click
()
cy
.
get
(
getTestSelector
(
'
nft-details-traits
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-details-activity
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-details-description
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-details-asset-details
'
)).
should
(
'
exist
'
)
})
it
(
'
should toggle buy now on details page
'
,
()
=>
{
cy
.
get
(
getTestSelector
(
'
nft-details-description-text
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-details-description
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-details-description-text
'
)).
should
(
'
not.exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-details-toggle-bag
'
)).
eq
(
1
).
click
()
cy
.
get
(
getTestSelector
(
'
nft-bag
'
)).
should
(
'
exist
'
)
})
it
(
'
should go view my nfts
'
,
()
=>
{
cy
.
get
(
getTestSelector
(
'
web3-status-connected
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-view-self-nfts
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-explore-nfts-button
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-no-nfts-selected
'
)).
should
(
'
exist
'
)
cy
.
get
(
getTestSelector
(
'
nft-bag-close-icon
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-explore-nfts-button
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
nft-welcome-modal
'
)).
should
(
'
exist
'
)
})
})
src/components/WalletDropdown/AuthenticatedHeader.tsx
View file @
982c99b0
...
...
@@ -207,7 +207,12 @@ const AuthenticatedHeader = () => {
</
Text
>
<
USDText
>
$
{
amountUSD
.
toFixed
(
2
)
}
USD
</
USDText
>
</
BalanceWrapper
>
<
ProfileButton
onClick=
{
navigateToProfile
}
size=
{
ButtonSize
.
medium
}
emphasis=
{
ButtonEmphasis
.
medium
}
>
<
ProfileButton
data
-
testid=
"nft-view-self-nfts"
onClick=
{
navigateToProfile
}
size=
{
ButtonSize
.
medium
}
emphasis=
{
ButtonEmphasis
.
medium
}
>
<
Trans
>
View and sell NFTs
</
Trans
>
</
ProfileButton
>
{
isUnclaimed
&&
(
...
...
src/nft/components/bag/Bag.tsx
View file @
982c99b0
...
...
@@ -282,7 +282,11 @@ const Bag = () => {
return
(
<
Portal
>
{
!
(
isProfilePage
&&
profilePageState
===
ProfilePageStateType
.
LISTING
)
?
(
<
Column
zIndex=
{
isMobile
||
isOpen
?
'
modalOverTooltip
'
:
'
3
'
}
className=
{
styles
.
bagContainer
}
>
<
Column
data
-
testid=
"nft-bag"
zIndex=
{
isMobile
||
isOpen
?
'
modalOverTooltip
'
:
'
3
'
}
className=
{
styles
.
bagContainer
}
>
<
BagHeader
numberOfAssets=
{
isProfilePage
?
sellAssets
.
length
:
itemsInBag
.
length
}
closeBag=
{
handleCloseBag
}
...
...
src/nft/components/bag/BagHeader.tsx
View file @
982c99b0
...
...
@@ -86,7 +86,7 @@ export const BagHeader = ({ numberOfAssets, closeBag, resetFlow, isProfilePage }
</>
)
}
<
IconWrapper
onClick=
{
closeBag
}
>
<
BagCloseIcon
/>
<
BagCloseIcon
data
-
testid=
"nft-bag-close-icon"
/>
</
IconWrapper
>
</
Wrapper
>
)
...
...
src/nft/components/bag/EmptyContent.tsx
View file @
982c99b0
...
...
@@ -23,7 +23,9 @@ const EmptyState = () => {
)
}
</
Center
>
{
isProfilePage
?
(
<
Center
className=
{
subhead
}
>
No NFTs selected
</
Center
>
<
Center
data
-
testid=
"nft-no-nfts-selected"
className=
{
subhead
}
>
No NFTs selected
</
Center
>
)
:
(
<
Column
gap=
"16"
>
<
Center
data
-
testid=
"nft-empty-bag"
className=
{
subhead
}
style=
{
{
lineHeight
:
'
24px
'
}
}
>
...
...
src/nft/components/collection/Card.tsx
View file @
982c99b0
...
...
@@ -647,7 +647,7 @@ const DetailsLink = () => {
e
.
stopPropagation
()
}
}
>
<
Box
>
Details
</
Box
>
<
Box
data
-
testid=
"nft-details-link"
>
Details
</
Box
>
</
DetailsLinkContainer
>
)
}
...
...
src/nft/components/details/AssetDetails.tsx
View file @
982c99b0
...
...
@@ -394,6 +394,7 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
</
AssetPriceDetailsContainer
>
{
asset
.
traits
&&
(
<
InfoContainer
data
-
testid=
"nft-details-traits"
primaryHeader=
"Traits"
defaultOpen
secondaryHeader=
{
...
...
@@ -423,6 +424,7 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
primaryHeader=
"Activity"
defaultOpen
secondaryHeader=
{
formattedPrice
?
`Last Sale: ${formattedPrice} ETH`
:
undefined
}
data
-
testid=
"nft-details-activity"
>
<>
<
ActivitySelectContainer
$isHorizontalScroll
>
...
...
@@ -460,7 +462,12 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
)
}
</>
</
InfoContainer
>
<
InfoContainer
primaryHeader=
"Description"
defaultOpen
secondaryHeader=
{
null
}
>
<
InfoContainer
primaryHeader=
"Description"
defaultOpen
secondaryHeader=
{
null
}
data
-
testid=
"nft-details-description"
>
<>
<
ByText
>
By
</
ByText
>
{
asset
?.
creator
&&
asset
.
creator
?.
address
&&
(
...
...
@@ -473,7 +480,9 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
</
AddressTextLink
>
)
}
<
DescriptionText
>
{
collection
.
collectionDescription
}
</
DescriptionText
>
<
DescriptionText
data
-
testid=
"nft-details-description-text"
>
{
collection
.
collectionDescription
}
</
DescriptionText
>
<
SocialsContainer
>
{
collection
.
externalUrl
&&
<
Resource
name=
"Website"
link=
{
`${collection.externalUrl}`
}
/>
}
{
collection
.
twitterUrl
&&
<
Resource
name=
"Twitter"
link=
{
`https://twitter.com/${collection.twitterUrl}`
}
/>
}
...
...
@@ -481,7 +490,7 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
</
SocialsContainer
>
</>
</
InfoContainer
>
<
InfoContainer
primaryHeader=
"Details"
defaultOpen
secondaryHeader=
{
null
}
>
<
InfoContainer
primaryHeader=
"Details"
defaultOpen
secondaryHeader=
{
null
}
data
-
testid=
"nft-details-asset-details"
>
<
DetailsContainer
asset=
{
asset
}
collection=
{
collection
}
/>
</
InfoContainer
>
</
Column
>
...
...
src/nft/components/details/AssetPriceDetails.tsx
View file @
982c99b0
...
...
@@ -413,7 +413,7 @@ export const AssetPriceDetails = ({ asset, collection }: AssetPriceDetailsProps)
}
}
>
<
ThemedText
.
SubHeader
color=
"white"
lineHeight=
"20px"
>
<
span
>
{
assetInBag
?
'
Remove
'
:
'
Add to Bag
'
}
</
span
>
<
span
data
-
testid=
"nft-details-toggle-bag"
>
{
assetInBag
?
'
Remove
'
:
'
Add to Bag
'
}
</
span
>
</
ThemedText
.
SubHeader
>
</
BuyNowButton
>
</
BuyNowButtonContainer
>
...
...
src/nft/components/details/InfoContainer.tsx
View file @
982c99b0
...
...
@@ -65,6 +65,7 @@ const InfoContainer = ({
primaryHeader
,
secondaryHeader
,
defaultOpen
,
...
props
}:
{
children
:
JSX
.
Element
primaryHeader
:
string
...
...
@@ -75,7 +76,7 @@ const InfoContainer = ({
return
(
<
div
>
<
Header
isOpen=
{
isOpen
}
onClick=
{
()
=>
setIsOpen
(
!
isOpen
)
}
>
<
Header
{
...
props
}
isOpen=
{
isOpen
}
onClick=
{
()
=>
setIsOpen
(
!
isOpen
)
}
>
<
PrimaryHeader
>
{
primaryHeader
}
<
SecondaryHeader
>
{
secondaryHeader
}
</
SecondaryHeader
>
</
PrimaryHeader
>
...
...
src/nft/components/explore/WelcomeModal.tsx
View file @
982c99b0
...
...
@@ -87,7 +87,7 @@ export function WelcomeModal({ onDismissed }: { onDismissed: () => void }) {
return
(
<
Modal
isOpen=
{
isOpen
}
onSwipe=
{
dismiss
}
maxWidth=
{
720
}
isBottomSheet=
{
false
}
>
<
Container
>
<
Container
data
-
testid=
"nft-welcome-modal"
>
<
Background
{
...
(
theme
.
darkMode
?
BACKGROUND_IMAGE
.
dark
:
BACKGROUND_IMAGE
.
light
)}
alt=
"Welcome modal background"
...
...
src/nft/components/profile/view/EmptyWalletContent.tsx
View file @
982c99b0
...
...
@@ -45,7 +45,9 @@ export const EmptyWalletContent = () => {
<
EmptyWalletText
className=
{
headlineMedium
}
>
<
Trans
>
No NFTs in
</
Trans
>
{
shortenAddress
(
account
??
''
)
}
</
EmptyWalletText
>
<
ExploreNFTsButton
onClick=
{
()
=>
navigate
(
'
/nfts
'
)
}
>
Explore NFTs
</
ExploreNFTsButton
>
<
ExploreNFTsButton
data
-
testid=
"nft-explore-nfts-button"
onClick=
{
()
=>
navigate
(
'
/nfts
'
)
}
>
Explore NFTs
</
ExploreNFTsButton
>
</
EmptyWalletContainer
>
)
}
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