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
ae5aa29b
Commit
ae5aa29b
authored
Feb 28, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests
parent
73cad84f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
0 deletions
+93
-0
index.ts
mocks/contracts/index.ts
+54
-0
VerifiedContracts.pw.tsx
ui/pages/VerifiedContracts.pw.tsx
+39
-0
VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
..._/VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
+0
-0
VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
...__/VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
No files found.
mocks/contracts/index.ts
0 → 100644
View file @
ae5aa29b
import
type
{
VerifiedContract
,
VerifiedContractsResponse
}
from
'
types/api/contracts
'
;
export
const
contract1
:
VerifiedContract
=
{
address
:
{
hash
:
'
0xef490030ac0d53B70E304b6Bc5bF657dc6780bEB
'
,
implementation_name
:
null
,
is_contract
:
true
,
is_verified
:
null
,
name
:
'
MockERC20
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
coin_balance
:
'
2346534676900000008
'
,
compiler_version
:
'
v0.8.17+commit.8df45f5f
'
,
has_constructor_args
:
false
,
language
:
'
solidity
'
,
market_cap
:
null
,
optimization_enabled
:
false
,
tx_count
:
7334224
,
verified_at
:
'
2022-09-16T18:49:29.605179Z
'
,
};
export
const
contract2
:
VerifiedContract
=
{
address
:
{
hash
:
'
0xB2218bdEbe8e90f80D04286772B0968ead666942
'
,
implementation_name
:
null
,
is_contract
:
true
,
is_verified
:
null
,
name
:
'
EternalStorageProxyWithSomeExternalLibrariesAndEvenMore
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
coin_balance
:
'
9078234570352343999
'
,
compiler_version
:
'
v0.3.1+commit.0463ea4c
'
,
has_constructor_args
:
true
,
language
:
'
vyper
'
,
market_cap
:
null
,
optimization_enabled
:
true
,
tx_count
:
440
,
verified_at
:
'
2021-09-07T20:01:56.076979Z
'
,
};
export
const
baseResponse
:
VerifiedContractsResponse
=
{
items
:
[
contract1
,
contract2
,
],
next_page_params
:
{
items_count
:
'
50
'
,
smart_contract_id
:
'
172
'
,
},
};
ui/pages/VerifiedContracts.pw.tsx
0 → 100644
View file @
ae5aa29b
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
textAdMock
from
'
mocks/ad/textAd
'
;
import
*
as
verifiedContractsMock
from
'
mocks/contracts/index
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
VerifiedContracts
from
'
./VerifiedContracts
'
;
const
VERIFIED_CONTRACTS_API_URL
=
buildApiUrl
(
'
verified_contracts
'
);
test
.
beforeEach
(
async
({
page
})
=>
{
await
page
.
route
(
'
https://request-global.czilladx.com/serve/native.php?z=19260bf627546ab7242
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
textAdMock
.
duck
),
}));
await
page
.
route
(
textAdMock
.
duck
.
ad
.
thumbnail
,
(
route
)
=>
{
return
route
.
fulfill
({
status
:
200
,
path
:
'
./playwright/image_s.jpg
'
,
});
});
});
test
(
'
base view +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
VERIFIED_CONTRACTS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
verifiedContractsMock
.
baseResponse
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
VerifiedContracts
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/pages/__screenshots__/VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
0 → 100644
View file @
ae5aa29b
48.3 KB
ui/pages/__screenshots__/VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
0 → 100644
View file @
ae5aa29b
59.5 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