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
9a595730
Commit
9a595730
authored
Nov 24, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BlockDetails tests
parent
47c29dfa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
0 deletions
+136
-0
block.ts
mocks/blocks/block.ts
+84
-0
BlockDetails.pw.tsx
ui/block/BlockDetails.pw.tsx
+52
-0
BlockDetails.pw.tsx_dark-color-mode_regular-block-mobile-dark-mode-1.png
....tsx_dark-color-mode_regular-block-mobile-dark-mode-1.png
+0
-0
BlockDetails.pw.tsx_default_genesis-block-1.png
...enshots__/BlockDetails.pw.tsx_default_genesis-block-1.png
+0
-0
BlockDetails.pw.tsx_default_regular-block-mobile-dark-mode-1.png
...tails.pw.tsx_default_regular-block-mobile-dark-mode-1.png
+0
-0
BlockDetails.pw.tsx_mobile_regular-block-mobile-dark-mode-1.png
...etails.pw.tsx_mobile_regular-block-mobile-dark-mode-1.png
+0
-0
No files found.
mocks/blocks/block.ts
0 → 100644
View file @
9a595730
export
const
base
=
{
base_fee_per_gas
:
'
10000000000
'
,
burnt_fees
:
'
5449200000000000
'
,
burnt_fees_percentage
:
20.292245650793845
,
difficulty
:
'
340282366920938463463374607431768211454
'
,
extra_data
:
'
TODO
'
,
gas_limit
:
'
12500000
'
,
gas_target_percentage
:
-
91.28128
,
gas_used
:
'
544920
'
,
gas_used_percentage
:
4.35936
,
hash
:
'
0xccc75136de485434d578b73df66537c06b34c3c9b12d085daf95890c914fc2bc
'
,
height
:
30146364
,
miner
:
{
hash
:
'
0xdAd49e6CbDE849353ab27DeC6319E687BFc91A41
'
,
implementation_name
:
null
,
is_contract
:
false
,
is_verified
:
null
,
name
:
'
Alex Emelyanov
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
nonce
:
'
0x0000000000000000
'
,
parent_hash
:
'
0x44125f0eb36a9d942e0c23bb4e8117f7ba86a9537a69b59c0025986ed2b7500f
'
,
priority_fee
:
'
23211757500000000
'
,
rewards
:
[
{
reward
:
'
500000000000000000
'
,
type
:
'
POA Mania Reward
'
,
},
{
reward
:
'
1026853607500000000
'
,
type
:
'
Validator Reward
'
,
},
{
reward
:
'
500000000000000000
'
,
type
:
'
Emission Reward
'
,
},
],
size
:
2448
,
state_root
:
'
TODO
'
,
timestamp
:
'
2022-10-24T11:46:05.000000Z
'
,
total_difficulty
:
'
10258276095980170141167591583995189665817672619
'
,
tx_count
:
5
,
tx_fees
:
'
26853607500000000
'
,
type
:
'
block
'
,
uncles_hashes
:
[],
};
export
const
genesis
=
{
base_fee_per_gas
:
null
,
burnt_fees
:
null
,
burnt_fees_percentage
:
null
,
difficulty
:
'
131072
'
,
extra_data
:
'
TODO
'
,
gas_limit
:
'
6700000
'
,
gas_target_percentage
:
-
100
,
gas_used
:
'
0
'
,
gas_used_percentage
:
0
,
hash
:
'
0x39f02c003dde5b073b3f6e1700fc0b84b4877f6839bb23edadd3d2d82a488634
'
,
height
:
0
,
miner
:
{
hash
:
'
0x0000000000000000000000000000000000000000
'
,
implementation_name
:
null
,
is_contract
:
false
,
is_verified
:
null
,
name
:
null
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
nonce
:
'
0x0000000000000000
'
,
parent_hash
:
'
0x0000000000000000000000000000000000000000000000000000000000000000
'
,
priority_fee
:
null
,
rewards
:
[],
size
:
533
,
state_root
:
'
TODO
'
,
timestamp
:
'
2017-12-16T00:13:24.000000Z
'
,
total_difficulty
:
'
131072
'
,
tx_count
:
0
,
tx_fees
:
'
0
'
,
type
:
'
block
'
,
uncles_hashes
:
[],
};
ui/block/BlockDetails.pw.tsx
0 → 100644
View file @
9a595730
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
blockMock
from
'
mocks/blocks/block
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
BlockDetails
from
'
./BlockDetails
'
;
const
API_URL
=
'
/node-api/blocks/1
'
;
const
hooksConfig
=
{
router
:
{
query
:
{
id
:
1
},
},
};
test
(
'
regular block +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
blockMock
.
base
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
BlockDetails
/>
</
TestApp
>,
{
hooksConfig
},
);
await
page
.
waitForResponse
(
API_URL
),
await
page
.
getByText
(
'
View details
'
).
click
();
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
genesis block
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
blockMock
.
genesis
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
BlockDetails
/>
</
TestApp
>,
{
hooksConfig
},
);
await
page
.
waitForResponse
(
API_URL
),
await
page
.
getByText
(
'
View details
'
).
click
();
await
expect
(
component
).
toHaveScreenshot
();
});
ui/block/__screenshots__/BlockDetails.pw.tsx_dark-color-mode_regular-block-mobile-dark-mode-1.png
0 → 100644
View file @
9a595730
103 KB
ui/block/__screenshots__/BlockDetails.pw.tsx_default_genesis-block-1.png
0 → 100644
View file @
9a595730
51.8 KB
ui/block/__screenshots__/BlockDetails.pw.tsx_default_regular-block-mobile-dark-mode-1.png
0 → 100644
View file @
9a595730
101 KB
ui/block/__screenshots__/BlockDetails.pw.tsx_mobile_regular-block-mobile-dark-mode-1.png
0 → 100644
View file @
9a595730
89.8 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