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
421cb9c0
Commit
421cb9c0
authored
Dec 01, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update utilization message
parent
3846a6f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
+12
-6
BlocksTabSlot.tsx
ui/blocks/BlocksTabSlot.tsx
+1
-1
Blocks.pw.tsx
ui/pages/Blocks.pw.tsx
+11
-5
Blocks.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
Blocks.pw.tsx_default_base-view-mobile-dark-mode-1.png
...__/Blocks.pw.tsx_default_base-view-mobile-dark-mode-1.png
+0
-0
No files found.
ui/blocks/BlocksTabSlot.tsx
View file @
421cb9c0
...
@@ -34,7 +34,7 @@ const BlocksTabSlot = ({ pagination }: Props) => {
...
@@ -34,7 +34,7 @@ const BlocksTabSlot = ({ pagination }: Props) => {
{
statsQuery
.
data
?.
network_utilization_percentage
!==
undefined
&&
(
{
statsQuery
.
data
?.
network_utilization_percentage
!==
undefined
&&
(
<
Box
>
<
Box
>
<
Text
as=
"span"
fontSize=
"sm"
>
<
Text
as=
"span"
fontSize=
"sm"
>
Network utilization:
{
nbsp
}
Network utilization
(last 50 blocks)
:
{
nbsp
}
</
Text
>
</
Text
>
<
Text
as=
"span"
fontSize=
"sm"
color=
"blue.400"
fontWeight=
{
600
}
>
<
Text
as=
"span"
fontSize=
"sm"
color=
"blue.400"
fontWeight=
{
600
}
>
{
statsQuery
.
data
.
network_utilization_percentage
.
toFixed
(
2
)
}
%
{
statsQuery
.
data
.
network_utilization_percentage
.
toFixed
(
2
)
}
%
...
...
ui/pages/Blocks.pw.tsx
View file @
421cb9c0
...
@@ -2,12 +2,14 @@ import { test as base, expect } from '@playwright/experimental-ct-react';
...
@@ -2,12 +2,14 @@ import { test as base, expect } from '@playwright/experimental-ct-react';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
*
as
blockMock
from
'
mocks/blocks/block
'
;
import
*
as
blockMock
from
'
mocks/blocks/block
'
;
import
*
as
statsMock
from
'
mocks/stats/index
'
;
import
*
as
socketServer
from
'
playwright/fixtures/socketServer
'
;
import
*
as
socketServer
from
'
playwright/fixtures/socketServer
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
Blocks
from
'
./Blocks
'
;
import
Blocks
from
'
./Blocks
'
;
const
API_URL
=
'
/node-api/blocks
'
;
const
BLOCKS_API_URL
=
'
/node-api/blocks
'
;
const
STATS_API_URL
=
'
/node-api/stats
'
;
const
hooksConfig
=
{
const
hooksConfig
=
{
router
:
{
router
:
{
query
:
{
tab
:
1
},
query
:
{
tab
:
1
},
...
@@ -24,10 +26,14 @@ export const test = base.extend<socketServer.SocketServerFixture>({
...
@@ -24,10 +26,14 @@ export const test = base.extend<socketServer.SocketServerFixture>({
test
.
describe
.
configure
({
mode
:
'
serial
'
});
test
.
describe
.
configure
({
mode
:
'
serial
'
});
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
BLOCKS_
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
}));
}));
await
page
.
route
(
STATS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
statsMock
.
base
),
}));
const
component
=
await
mount
(
const
component
=
await
mount
(
<
TestApp
>
<
TestApp
>
...
@@ -35,13 +41,13 @@ test('base view +@mobile +@dark-mode', async({ mount, page }) => {
...
@@ -35,13 +41,13 @@ test('base view +@mobile +@dark-mode', async({ mount, page }) => {
</
TestApp
>,
</
TestApp
>,
{
hooksConfig
},
{
hooksConfig
},
);
);
await
page
.
waitForResponse
(
API_URL
);
await
page
.
waitForResponse
(
BLOCKS_
API_URL
);
await
expect
(
component
.
locator
(
'
main
'
)).
toHaveScreenshot
();
await
expect
(
component
.
locator
(
'
main
'
)).
toHaveScreenshot
();
});
});
test
(
'
new item from socket
'
,
async
({
mount
,
page
,
createSocket
})
=>
{
test
(
'
new item from socket
'
,
async
({
mount
,
page
,
createSocket
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
BLOCKS_
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
}));
}));
...
@@ -68,7 +74,7 @@ test('new item from socket', async({ mount, page, createSocket }) => {
...
@@ -68,7 +74,7 @@ test('new item from socket', async({ mount, page, createSocket }) => {
});
});
test
(
'
socket error
'
,
async
({
mount
,
page
,
createSocket
})
=>
{
test
(
'
socket error
'
,
async
({
mount
,
page
,
createSocket
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
BLOCKS_
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
body
:
JSON
.
stringify
(
blockMock
.
baseListResponse
),
}));
}));
...
...
ui/pages/__screenshots__/Blocks.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
View replaced file @
3846a6f8
View file @
421cb9c0
40.4 KB
|
W:
|
H:
44.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/pages/__screenshots__/Blocks.pw.tsx_default_base-view-mobile-dark-mode-1.png
View replaced file @
3846a6f8
View file @
421cb9c0
39.7 KB
|
W:
|
H:
43.5 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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