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
628fac3d
Commit
628fac3d
authored
Apr 13, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for l2 fields
parent
4731cb8e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
.env.pw
configs/envs/.env.pw
+1
-0
tx.ts
mocks/txs/tx.ts
+8
-0
TxDetails.pw.tsx
ui/tx/TxDetails.pw.tsx
+26
-0
TxDetails.pw.tsx_default_l2-1.png
ui/tx/__screenshots__/TxDetails.pw.tsx_default_l2-1.png
+0
-0
No files found.
configs/envs/.env.pw
View file @
628fac3d
...
@@ -15,6 +15,7 @@ NEXT_PUBLIC_NETWORK_LOGO=
...
@@ -15,6 +15,7 @@ NEXT_PUBLIC_NETWORK_LOGO=
NEXT_PUBLIC_NETWORK_SMALL_LOGO=
NEXT_PUBLIC_NETWORK_SMALL_LOGO=
NEXT_PUBLIC_NETWORK_RPC_URL=https://core.poa.network
NEXT_PUBLIC_NETWORK_RPC_URL=https://core.poa.network
NEXT_PUBLIC_IS_TESTNET=true
NEXT_PUBLIC_IS_TESTNET=true
NEXT_PUBLIC_IS_L2_NETWORK=false
# api config
# api config
NEXT_PUBLIC_API_HOST=blockscout.com
NEXT_PUBLIC_API_HOST=blockscout.com
...
...
mocks/txs/tx.ts
View file @
628fac3d
...
@@ -242,3 +242,11 @@ export const withActionsUniswap: Transaction = {
...
@@ -242,3 +242,11 @@ export const withActionsUniswap: Transaction = {
},
},
],
],
};
};
export
const
l2tx
:
Transaction
=
{
...
base
,
l1_gas_price
:
'
82702201886
'
,
l1_fee_scalar
:
'
1.0
'
,
l1_gas_used
:
'
17060
'
,
l1_fee
:
'
1584574188135760
'
,
};
ui/tx/TxDetails.pw.tsx
View file @
628fac3d
...
@@ -2,6 +2,7 @@ import { test, expect } from '@playwright/experimental-ct-react';
...
@@ -2,6 +2,7 @@ import { test, expect } from '@playwright/experimental-ct-react';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
*
as
txMock
from
'
mocks/txs/tx
'
;
import
*
as
txMock
from
'
mocks/txs/tx
'
;
import
contextWithEnvs
from
'
playwright/fixtures/contextWithEnvs
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
insertAdPlaceholder
from
'
playwright/utils/insertAdPlaceholder
'
;
import
insertAdPlaceholder
from
'
playwright/utils/insertAdPlaceholder
'
;
...
@@ -141,3 +142,28 @@ test('with actions uniswap +@mobile +@dark-mode', async({ mount, page }) => {
...
@@ -141,3 +142,28 @@ test('with actions uniswap +@mobile +@dark-mode', async({ mount, page }) => {
await
insertAdPlaceholder
(
page
);
await
insertAdPlaceholder
(
page
);
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
const
l2Test
=
test
.
extend
({
context
:
contextWithEnvs
([
{
name
:
'
NEXT_PUBLIC_IS_L2_NETWORK
'
,
value
:
'
true
'
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
])
as
any
,
});
l2Test
(
'
l2
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
txMock
.
l2tx
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TxDetails
/>
</
TestApp
>,
{
hooksConfig
},
);
await
insertAdPlaceholder
(
page
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/tx/__screenshots__/TxDetails.pw.tsx_default_l2-1.png
0 → 100644
View file @
628fac3d
109 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