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
bb5b5fac
Commit
bb5b5fac
authored
Nov 25, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TxInternals tests
parent
3161c4f8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
6 deletions
+124
-6
tasks.json
.vscode/tasks.json
+3
-3
internalTxs.ts
mocks/txs/internalTxs.ts
+75
-0
internalTransaction.ts
types/api/internalTransaction.ts
+1
-1
TxInternals.pw.tsx
ui/tx/TxInternals.pw.tsx
+40
-0
TxInternals.pw.tsx_default_base-view-mobile-1.png
...shots__/TxInternals.pw.tsx_default_base-view-mobile-1.png
+0
-0
TxInternals.pw.tsx_mobile_base-view-mobile-1.png
...nshots__/TxInternals.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
TxInternalsListItem.tsx
ui/tx/internals/TxInternalsListItem.tsx
+3
-1
TxInternalsTableItem.tsx
ui/tx/internals/TxInternalsTableItem.tsx
+2
-1
No files found.
.vscode/tasks.json
View file @
bb5b5fac
...
...
@@ -106,7 +106,7 @@
//
PW
TESTS
{
"type"
:
"shell"
,
"command"
:
"${input:pwDebugFlag} yarn test:pw:local ${relativeFileDirname}/${fileBasename
NoExtension
} ${input:pwArgs}"
,
"command"
:
"${input:pwDebugFlag} yarn test:pw:local ${relativeFileDirname}/${fileBasename} ${input:pwArgs}"
,
"problemMatcher"
:
[],
"label"
:
"test: playwright: local for current file"
,
"detail"
:
"run visual components tests for current file"
,
...
...
@@ -124,7 +124,7 @@
},
{
"type"
:
"shell"
,
"command"
:
"yarn test:pw:docker ${relativeFileDirname}/${fileBasename
NoExtension
} ${input:pwArgs}"
,
"command"
:
"yarn test:pw:docker ${relativeFileDirname}/${fileBasename} ${input:pwArgs}"
,
"problemMatcher"
:
[],
"label"
:
"test: playwright: docker for current file"
,
"detail"
:
"run visual components tests for current file"
,
...
...
@@ -199,7 +199,7 @@
},
{
"type"
:
"shell"
,
"command"
:
"yarn test:jest ${relativeFileDirname}/${fileBasename
NoExtension
} --watch"
,
"command"
:
"yarn test:jest ${relativeFileDirname}/${fileBasename} --watch"
,
"problemMatcher"
:
[],
"label"
:
"test: jest: watch curent file"
,
"detail"
:
"run jest tests in watch mode for current file"
,
...
...
mocks/txs/internalTxs.ts
0 → 100644
View file @
bb5b5fac
import
type
{
InternalTransaction
,
InternalTransactionsResponse
}
from
'
types/api/internalTransaction
'
;
export
const
base
:
InternalTransaction
=
{
block
:
29611822
,
created_contract
:
null
,
error
:
null
,
from
:
{
hash
:
'
0xd789a607CEac2f0E14867de4EB15b15C9FFB5859
'
,
implementation_name
:
null
,
is_contract
:
true
,
is_verified
:
true
,
name
:
'
ArianeeStore
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
gas_limit
:
'
757586
'
,
index
:
1
,
success
:
true
,
timestamp
:
'
2022-10-10T14:43:05.000000Z
'
,
to
:
{
hash
:
'
0x502a9C8af2441a1E276909405119FaE21F3dC421
'
,
implementation_name
:
null
,
is_contract
:
true
,
is_verified
:
true
,
name
:
'
ArianeeCreditHistory
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
transaction_hash
:
'
0xe9e27dfeb183066e26cfe556f74b7219b08df6951e25d14003d4fc7af8bbff61
'
,
type
:
'
call
'
,
value
:
'
42000000000000000000
'
,
};
export
const
typeStaticCall
:
InternalTransaction
=
{
...
base
,
type
:
'
staticcall
'
,
to
:
{
...
base
.
to
,
name
:
null
,
},
gas_limit
:
'
63424243
'
,
};
export
const
withContractCreated
:
InternalTransaction
=
{
...
base
,
type
:
'
delegatecall
'
,
to
:
null
,
from
:
{
...
base
.
from
,
name
:
null
,
},
created_contract
:
{
hash
:
'
0xdda21946FF3FAa027104b15BE6970CA756439F5a
'
,
implementation_name
:
null
,
is_contract
:
true
,
is_verified
:
null
,
name
:
'
Shavuha token
'
,
private_tags
:
[],
public_tags
:
[],
watchlist_names
:
[],
},
value
:
'
1420000000000000000
'
,
gas_limit
:
'
5433
'
,
};
export
const
baseResponse
:
InternalTransactionsResponse
=
{
items
:
[
base
,
typeStaticCall
,
withContractCreated
,
],
next_page_params
:
null
,
};
types/api/internalTransaction.ts
View file @
bb5b5fac
...
...
@@ -32,5 +32,5 @@ export interface InternalTransactionsResponse {
items_count
:
number
;
transaction_hash
:
string
;
transaction_index
:
number
;
};
}
|
null
;
}
ui/tx/TxInternals.pw.tsx
0 → 100644
View file @
bb5b5fac
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
internalTxsMock
from
'
mocks/txs/internalTxs
'
;
import
*
as
txMock
from
'
mocks/txs/tx
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TxInternals
from
'
./TxInternals
'
;
const
TX_HASH
=
txMock
.
base
.
hash
;
const
API_URL_TX
=
`/node-api/transactions/
${
TX_HASH
}
`
;
const
API_URL_TX_INTERNALS
=
`/node-api/transactions/
${
TX_HASH
}
/internal-transactions`
;
const
hooksConfig
=
{
router
:
{
query
:
{
id
:
TX_HASH
},
},
};
test
(
'
base view +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
API_URL_TX
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
txMock
.
base
),
}));
await
page
.
route
(
API_URL_TX_INTERNALS
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
internalTxsMock
.
baseResponse
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TxInternals
/>
</
TestApp
>,
{
hooksConfig
},
);
await
page
.
waitForResponse
(
API_URL_TX
),
await
page
.
waitForResponse
(
API_URL_TX_INTERNALS
),
await
expect
(
component
).
toHaveScreenshot
();
});
ui/tx/__screenshots__/TxInternals.pw.tsx_default_base-view-mobile-1.png
0 → 100644
View file @
bb5b5fac
33 KB
ui/tx/__screenshots__/TxInternals.pw.tsx_mobile_base-view-mobile-1.png
0 → 100644
View file @
bb5b5fac
33.9 KB
ui/tx/internals/TxInternalsListItem.tsx
View file @
bb5b5fac
...
...
@@ -38,7 +38,9 @@ const TxInternalsListItem = ({ type, from, to, value, success, error, gas_limit:
</
Box
>
<
HStack
spacing=
{
3
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Value
{
appConfig
.
network
.
currency
.
symbol
}
</
Text
>
<
Text
fontSize=
"sm"
variant=
"secondary"
>
{
value
}
</
Text
>
<
Text
fontSize=
"sm"
variant=
"secondary"
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
appConfig
.
network
.
currency
.
decimals
)).
toFormat
()
}
</
Text
>
</
HStack
>
<
HStack
spacing=
{
3
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Gas limit
</
Text
>
...
...
ui/tx/internals/TxInternalsTableItem.tsx
View file @
bb5b5fac
...
...
@@ -4,6 +4,7 @@ import React from 'react';
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
appConfig
from
'
configs/app/config
'
;
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
...
...
@@ -45,7 +46,7 @@ const TxInternalTableItem = ({ type, from, to, value, success, error, gas_limit:
</
Address
>
</
Td
>
<
Td
isNumeric
verticalAlign=
"middle"
>
{
value
}
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
appConfig
.
network
.
currency
.
decimals
)).
toFormat
()
}
</
Td
>
<
Td
isNumeric
verticalAlign=
"middle"
>
{
BigNumber
(
gasLimit
).
toFormat
()
}
...
...
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