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
77766fa6
Commit
77766fa6
authored
May 07, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor TokenInstanceDetails test
parent
c3a32164
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
22 deletions
+6
-22
TokenInstanceDetails.pw.tsx
ui/tokenInstance/TokenInstanceDetails.pw.tsx
+6
-22
No files found.
ui/tokenInstance/TokenInstanceDetails.pw.tsx
View file @
77766fa6
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
{
tokenInfoERC721a
}
from
'
mocks/tokens/tokenInfo
'
;
import
{
tokenInfoERC721a
}
from
'
mocks/tokens/tokenInfo
'
;
import
*
as
tokenInstanceMock
from
'
mocks/tokens/tokenInstance
'
;
import
*
as
tokenInstanceMock
from
'
mocks/tokens/tokenInstance
'
;
import
{
test
,
expect
}
from
'
playwright/lib
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
*
as
configs
from
'
playwright/utils/configs
'
;
import
*
as
configs
from
'
playwright/utils/configs
'
;
import
TokenInstanceDetails
from
'
./TokenInstanceDetails
'
;
import
TokenInstanceDetails
from
'
./TokenInstanceDetails
'
;
const
hash
=
tokenInfoERC721a
.
address
;
const
hash
=
tokenInfoERC721a
.
address
;
const
API_URL_ADDRESS
=
buildApiUrl
(
'
address
'
,
{
hash
});
test
(
'
base view +@dark-mode +@mobile
'
,
async
({
render
,
page
,
mockApiResponse
,
mockAssetResponse
})
=>
{
const
API_URL_TOKEN_TRANSFERS_COUNT
=
buildApiUrl
(
'
token_instance_transfers_count
'
,
{
await
mockApiResponse
(
'
address
'
,
addressMock
.
contract
,
{
pathParams
:
{
hash
}
});
id
:
tokenInstanceMock
.
unique
.
id
,
await
mockApiResponse
(
'
token_instance_transfers_count
'
,
{
transfers_count
:
42
},
{
pathParams
:
{
id
:
tokenInstanceMock
.
unique
.
id
,
hash
}
});
hash
,
await
mockAssetResponse
(
'
http://localhost:3000/nft-marketplace-logo.png
'
,
'
./playwright/mocks/image_s.jpg
'
);
});
test
(
'
base view +@dark-mode +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
'
http://localhost:3000/nft-marketplace-logo.png
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
path
:
'
./playwright/mocks/image_s.jpg
'
,
}));
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
(
const
component
=
await
render
(
<
TestApp
>
<
TestApp
>
<
TokenInstanceDetails
data=
{
tokenInstanceMock
.
unique
}
token=
{
tokenInfoERC721a
}
/>
<
TokenInstanceDetails
data=
{
tokenInstanceMock
.
unique
}
token=
{
tokenInfoERC721a
}
/>
</
TestApp
>,
</
TestApp
>,
...
...
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