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
10faf2dd
Commit
10faf2dd
authored
Nov 22, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TxLogItem test
parent
1bf60763
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
97 additions
and
4 deletions
+97
-4
address.ts
mocks/address/address.ts
+21
-0
viewports.ts
playwright/viewports.ts
+1
-1
addressParams.ts
types/api/addressParams.ts
+1
-1
log.ts
types/api/log.ts
+1
-1
TxLogItem.pw.tsx
ui/tx/logs/TxLogItem.pw.tsx
+71
-0
TxLogItem.tsx
ui/tx/logs/TxLogItem.tsx
+2
-1
TxLogItem.pw.tsx_desktop-dark-color-mode-1.png
...eenshots__/TxLogItem.pw.tsx_desktop-dark-color-mode-1.png
+0
-0
TxLogItem.pw.tsx_desktop-with-decoded-input-data-1.png
...__/TxLogItem.pw.tsx_desktop-with-decoded-input-data-1.png
+0
-0
TxLogItem.pw.tsx_desktop-without-decoded-input-data-1.png
...TxLogItem.pw.tsx_desktop-without-decoded-input-data-1.png
+0
-0
TxLogItem.pw.tsx_mobile-dark-color-mode-1.png
...reenshots__/TxLogItem.pw.tsx_mobile-dark-color-mode-1.png
+0
-0
TxLogItem.pw.tsx_mobile-with-decoded-input-data-1.png
...s__/TxLogItem.pw.tsx_mobile-with-decoded-input-data-1.png
+0
-0
TxLogItem.pw.tsx_mobile-without-decoded-input-data-1.png
.../TxLogItem.pw.tsx_mobile-without-decoded-input-data-1.png
+0
-0
No files found.
mocks/address/address.ts
0 → 100644
View file @
10faf2dd
import
type
{
AddressParam
}
from
'
types/api/addressParams
'
;
export
const
withName
:
AddressParam
=
{
hash
:
'
0xd789a607CEac2f0E14867de4EB15b15C9FFB5859
'
,
implementation_name
:
null
,
is_contract
:
true
,
name
:
'
ArianeeStore
'
,
private_tags
:
[],
watchlist_names
:
[],
public_tags
:
[],
};
export
const
withoutName
:
AddressParam
=
{
hash
:
'
0xd789a607CEac2f0E14867de4EB15b15C9FFB5859
'
,
implementation_name
:
null
,
is_contract
:
true
,
name
:
null
,
private_tags
:
[],
watchlist_names
:
[],
public_tags
:
[],
};
playwright/viewports.ts
View file @
10faf2dd
export
const
DESKTOP
=
{
width
:
1000
,
height
:
625
};
export
const
DESKTOP_XL
=
{
width
:
1440
,
height
:
900
};
export
const
MOBILE
=
{
width
:
390
,
height
:
844
};
types/api/addressParams.ts
View file @
10faf2dd
...
...
@@ -11,7 +11,7 @@ export interface WatchlistName {
export
interface
AddressParam
{
hash
:
string
;
implementation_name
:
string
;
implementation_name
:
string
|
null
;
name
:
string
|
null
;
is_contract
:
boolean
;
private_tags
:
Array
<
AddressTag
>
|
null
;
...
...
types/api/log.ts
View file @
10faf2dd
...
...
@@ -3,7 +3,7 @@ import type { DecodedInput } from './decodedInput';
export
interface
Log
{
address
:
AddressParam
;
topics
:
Array
<
string
>
;
topics
:
Array
<
string
|
null
>
;
data
:
string
;
index
:
number
;
decoded
:
DecodedInput
|
null
;
...
...
ui/tx/logs/TxLogItem.pw.tsx
0 → 100644
View file @
10faf2dd
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
addressMocks
from
'
mocks/address/address
'
;
import
*
as
inputDataMocks
from
'
mocks/txs/decodedInputData
'
;
import
RenderWithChakra
from
'
playwright/RenderWithChakra
'
;
import
{
DESKTOP
,
MOBILE
}
from
'
playwright/viewports
'
;
import
TxLogItem
from
'
./TxLogItem
'
;
const
TOPICS
=
[
'
0x3a4ec416703c36a61a4b1f690847f1963a6829eac0b52debd40a23b66c142a56
'
,
'
0x0000000000000000000000000000000000000000000000000000000005001bcf
'
,
'
0xe835d1028984e9e6e7d016b77164eacbcc6cc061e9333c0b37982b504f7ea791
'
,
null
,
];
const
DATA
=
'
0x0000000000000000000000000000000000000000000000000070265bf0112cee
'
;
[
{
name
:
'
desktop
'
,
viewport
:
DESKTOP
},
{
name
:
'
mobile
'
,
viewport
:
MOBILE
},
].
forEach
(({
name
,
viewport
})
=>
{
test
.
describe
(
name
,
()
=>
{
test
.
use
({
viewport
});
test
(
'
with decoded input data
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxLogItem
index=
{
42
}
decoded=
{
inputDataMocks
.
withIndexedFields
}
address=
{
addressMocks
.
withName
}
topics=
{
TOPICS
}
data=
{
DATA
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
without decoded input data
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxLogItem
index=
{
42
}
decoded=
{
null
}
address=
{
addressMocks
.
withoutName
}
topics=
{
TOPICS
}
data=
{
DATA
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
dark color mode
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
colorMode=
"dark"
>
<
TxLogItem
index=
{
42
}
decoded=
{
inputDataMocks
.
withIndexedFields
}
address=
{
addressMocks
.
withName
}
topics=
{
TOPICS
}
data=
{
DATA
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
});
});
ui/tx/logs/TxLogItem.tsx
View file @
10faf2dd
...
...
@@ -6,6 +6,7 @@ import type { Log } from 'types/api/log';
// import searchIcon from 'icons/search.svg';
import
{
space
}
from
'
lib/html-entities
'
;
import
link
from
'
lib/link/link
'
;
import
notEmpty
from
'
lib/notEmpty
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
...
@@ -74,7 +75,7 @@ const TxLogItem = ({ address, index, topics, data, decoded }: Props) => {
)
}
<
RowHeader
>
Topics
</
RowHeader
>
<
GridItem
>
{
topics
.
filter
(
Boolean
).
map
((
item
,
index
)
=>
(
{
topics
.
filter
(
notEmpty
).
map
((
item
,
index
)
=>
(
<
TxLogTopic
key=
{
index
}
hex=
{
item
}
...
...
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_desktop-dark-color-mode-1.png
0 → 100644
View file @
10faf2dd
59.1 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_desktop-with-decoded-input-data-1.png
0 → 100644
View file @
10faf2dd
57.3 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_desktop-without-decoded-input-data-1.png
0 → 100644
View file @
10faf2dd
38.5 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_mobile-dark-color-mode-1.png
0 → 100644
View file @
10faf2dd
51 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_mobile-with-decoded-input-data-1.png
0 → 100644
View file @
10faf2dd
49.3 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_mobile-without-decoded-input-data-1.png
0 → 100644
View file @
10faf2dd
35.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