Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
47c7f5d5
Commit
47c7f5d5
authored
Feb 09, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests
parent
f36e186a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
7 deletions
+57
-7
tokenInstance.ts
mocks/tokens/tokenInstance.ts
+22
-0
tokens.ts
types/api/tokens.ts
+1
-1
TokenInstanceDetails.pw.tsx
ui/tokenInstance/TokenInstanceDetails.pw.tsx
+34
-0
TokenInstanceDetails.tsx
ui/tokenInstance/TokenInstanceDetails.tsx
+0
-6
TokenInstanceDetails.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
...s.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
+0
-0
TokenInstanceDetails.pw.tsx_default_base-view-mobile-dark-mode-1.png
...ceDetails.pw.tsx_default_base-view-mobile-dark-mode-1.png
+0
-0
TokenInstanceDetails.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
...nceDetails.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
+0
-0
No files found.
mocks/tokens/tokenInstance.ts
0 → 100644
View file @
47c7f5d5
import
type
{
TokenInstance
}
from
'
types/api/tokens
'
;
import
*
as
addressMock
from
'
../address/address
'
;
import
{
tokenInfoERC721a
}
from
'
./tokenInfo
'
;
export
const
base
:
TokenInstance
=
{
animation_url
:
null
,
external_app_url
:
null
,
id
:
'
32925298983216553915666621415831103694597106215670571463977478984525997408266
'
,
image_url
:
null
,
is_unique
:
false
,
holder_address_hash
:
null
,
metadata
:
{
animation_url
:
null
,
description
:
'
Sign for you!
'
,
external_link
:
null
,
image
:
'
https://i.seadn.io/gcs/files/1ee1c5e1ead058322615e3206abb8ba3.png?w=500&auto=format
'
,
name
:
'
Sign4U
'
,
},
owner
:
addressMock
.
withName
,
token
:
tokenInfoERC721a
,
};
types/api/tokens.ts
View file @
47c7f5d5
...
...
@@ -13,7 +13,7 @@ export type TokensResponse = {
export
type
TokensFilters
=
{
filter
:
string
;
type
:
Array
<
TokenType
>
|
undefined
};
export
interface
TokenInstance
{
is_unique
:
string
;
is_unique
:
boolean
;
id
:
string
;
holder_address_hash
:
string
|
null
;
image_url
:
string
|
null
;
...
...
ui/tokenInstance/TokenInstanceDetails.pw.tsx
0 → 100644
View file @
47c7f5d5
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
tokenInstanceMock
from
'
mocks/tokens/tokenInstance
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
TokenInstanceDetails
from
'
./TokenInstanceDetails
'
;
const
API_URL_ADDRESS
=
buildApiUrl
(
'
address
'
,
{
id
:
tokenInstanceMock
.
base
.
token
.
address
});
const
API_URL_TOKEN_TRANSFERS_COUNT
=
buildApiUrl
(
'
token_instance_transfers_count
'
,
{
id
:
tokenInstanceMock
.
base
.
id
,
hash
:
tokenInstanceMock
.
base
.
token
.
address
,
});
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL_ADDRESS
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
addressMock
.
contract
),
}));
await
page
.
route
(
API_URL_TOKEN_TRANSFERS_COUNT
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
({
transfers_count
:
42
}),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TokenInstanceDetails
data=
{
tokenInstanceMock
.
base
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/tokenInstance/TokenInstanceDetails.tsx
View file @
47c7f5d5
...
...
@@ -64,12 +64,6 @@ const TokenInstanceDetails = ({ data, scrollRef }: Props) => {
<
CopyToClipboard
text=
{
data
.
id
}
ml=
{
1
}
/>
</
Flex
>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Quantity"
hint=
"Current quantity of this token instance."
>
1
</
DetailsInfoItem
>
<
TokenInstanceTransfersCount
hash=
{
data
.
token
.
address
}
id=
{
data
.
id
}
onClick=
{
handleCounterItemClick
}
/>
</
Grid
>
<
NftImage
url=
{
data
.
image_url
}
w=
"250px"
flexShrink=
{
0
}
alignSelf=
{
{
base
:
'
center
'
,
lg
:
'
flex-start
'
}
}
/>
...
...
ui/tokenInstance/__screenshots__/TokenInstanceDetails.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
0 → 100644
View file @
47c7f5d5
45.4 KB
ui/tokenInstance/__screenshots__/TokenInstanceDetails.pw.tsx_default_base-view-mobile-dark-mode-1.png
0 → 100644
View file @
47c7f5d5
44.8 KB
ui/tokenInstance/__screenshots__/TokenInstanceDetails.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
0 → 100644
View file @
47c7f5d5
39.3 KB
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