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
b4ae8b9e
Commit
b4ae8b9e
authored
Jan 04, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sub-header
parent
a078553c
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
64 additions
and
19 deletions
+64
-19
configs.ts
playwright/utils/configs.ts
+3
-0
TxSubHeading.pw.tsx
ui/tx/TxSubHeading.pw.tsx
+59
-0
TxSubHeading.tsx
ui/tx/TxSubHeading.tsx
+2
-2
TxSubHeading.pw.tsx_dark-color-mode_with-interpretation-mobile-dark-mode-1.png
...ark-color-mode_with-interpretation-mobile-dark-mode-1.png
+0
-0
TxSubHeading.pw.tsx_default_no-interpretation-1.png
...ots__/TxSubHeading.pw.tsx_default_no-interpretation-1.png
+0
-0
TxSubHeading.pw.tsx_default_no-interpretation-mobile-1.png
...xSubHeading.pw.tsx_default_no-interpretation-mobile-1.png
+0
-0
TxSubHeading.pw.tsx_default_with-interpretation-mobile-dark-mode-1.png
...pw.tsx_default_with-interpretation-mobile-dark-mode-1.png
+0
-0
TxSubHeading.pw.tsx_mobile_no-interpretation-mobile-1.png
...TxSubHeading.pw.tsx_mobile_no-interpretation-mobile-1.png
+0
-0
TxSubHeading.pw.tsx_mobile_with-interpretation-mobile-dark-mode-1.png
....pw.tsx_mobile_with-interpretation-mobile-dark-mode-1.png
+0
-0
TxInterpretation.pw.tsx
ui/tx/interpretation/TxInterpretation.pw.tsx
+0
-17
TxInterpretation.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
...n.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
+0
-0
TxInterpretation.pw.tsx_default_base-view-mobile-dark-mode-1.png
...pretation.pw.tsx_default_base-view-mobile-dark-mode-1.png
+0
-0
TxInterpretation.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
...rpretation.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
+0
-0
No files found.
playwright/utils/configs.ts
View file @
b4ae8b9e
...
...
@@ -29,6 +29,9 @@ export const featureEnvs = {
value
:
'
[{"type":"omni","title":"OmniBridge","short_title":"OMNI"},{"type":"amb","title":"Arbitrary Message Bridge","short_title":"AMB"}]
'
,
},
],
txInterpretation
:
[
{
name
:
'
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER
'
,
value
:
'
blockscout
'
},
],
zkRollup
:
[
{
name
:
'
NEXT_PUBLIC_IS_ZKEVM_L2_NETWORK
'
,
value
:
'
true
'
},
{
name
:
'
NEXT_PUBLIC_L1_BASE_URL
'
,
value
:
'
https://localhost:3101
'
},
...
...
ui/tx/TxSubHeading.pw.tsx
0 → 100644
View file @
b4ae8b9e
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
{
txInterpretation
}
from
'
mocks/txs/txInterpretation
'
;
import
contextWithEnvs
from
'
playwright/fixtures/contextWithEnvs
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
buildApiUrl
from
'
playwright/utils/buildApiUrl
'
;
import
*
as
configs
from
'
playwright/utils/configs
'
;
import
TxSubHeading
from
'
./TxSubHeading
'
;
const
hash
=
'
0x62d597ebcf3e8d60096dd0363bc2f0f5e2df27ba1dacd696c51aa7c9409f3193
'
;
const
TX_INTERPRETATION_API_URL
=
buildApiUrl
(
'
tx_interpretation
'
,
{
hash
});
test
(
'
no interpretation +@mobile
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
TxSubHeading
hash=
{
hash
}
hasTag=
{
false
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
const
bsInterpretationTest
=
test
.
extend
({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context
:
contextWithEnvs
(
configs
.
featureEnvs
.
txInterpretation
)
as
any
,
});
bsInterpretationTest
(
'
with interpretation +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
TX_INTERPRETATION_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
txInterpretation
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TxSubHeading
hash=
{
hash
}
hasTag=
{
false
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
bsInterpretationTest
(
'
no interpretation
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
TX_INTERPRETATION_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
({
data
:
{
summaries
:
[]
}
}),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TxSubHeading
hash=
{
hash
}
hasTag=
{
false
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/tx/TxSubHeading.tsx
View file @
b4ae8b9e
...
...
@@ -27,11 +27,11 @@ const TxSubHeading = ({ hash, hasTag }: Props) => {
});
const
hasInterpretation
=
hasInterpretationFeature
&&
(
txInterpretationQuery
.
isPlaceholderData
||
txInterpretationQuery
.
data
?.
data
.
summaries
.
length
);
(
txInterpretationQuery
.
isPlaceholderData
||
Boolean
(
txInterpretationQuery
.
data
?.
data
.
summaries
.
length
)
);
return
(
<
Box
display=
{
{
base
:
'
block
'
,
lg
:
'
flex
'
}
}
alignItems=
"center"
w=
"100%"
>
{
hasInterpretation
Feature
&&
(
{
hasInterpretation
&&
(
<
Flex
mr=
{
{
base
:
0
,
lg
:
6
}
}
flexWrap=
"wrap"
alignItems=
"center"
>
<
TxInterpretation
summary=
{
txInterpretationQuery
.
data
?.
data
.
summaries
[
0
]
}
...
...
ui/tx/__screenshots__/TxSubHeading.pw.tsx_dark-color-mode_with-interpretation-mobile-dark-mode-1.png
0 → 100644
View file @
b4ae8b9e
13.4 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_no-interpretation-1.png
0 → 100644
View file @
b4ae8b9e
8.81 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_no-interpretation-mobile-1.png
0 → 100644
View file @
b4ae8b9e
8.81 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_with-interpretation-mobile-dark-mode-1.png
0 → 100644
View file @
b4ae8b9e
12.8 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_mobile_no-interpretation-mobile-1.png
0 → 100644
View file @
b4ae8b9e
7.23 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_mobile_with-interpretation-mobile-dark-mode-1.png
0 → 100644
View file @
b4ae8b9e
12.7 KB
ui/tx/interpretation/TxInterpretation.pw.tsx
deleted
100644 → 0
View file @
a078553c
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
{
txInterpretation
as
txInterpretationMock
}
from
'
mocks/txs/txInterpretation
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TxInterpretation
from
'
./TxInterpretation
'
;
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
TxInterpretation
summary=
{
txInterpretationMock
.
data
.
summaries
[
0
]
}
isLoading=
{
false
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/tx/interpretation/__screenshots__/TxInterpretation.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
deleted
100644 → 0
View file @
a078553c
9.17 KB
ui/tx/interpretation/__screenshots__/TxInterpretation.pw.tsx_default_base-view-mobile-dark-mode-1.png
deleted
100644 → 0
View file @
a078553c
8.93 KB
ui/tx/interpretation/__screenshots__/TxInterpretation.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
deleted
100644 → 0
View file @
a078553c
8.59 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