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
c28d5020
Commit
c28d5020
authored
Nov 22, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for TxDecodedInputData
parent
76c812b9
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
120 additions
and
4 deletions
+120
-4
.eslintrc.js
.eslintrc.js
+1
-1
decodedInputData.ts
mocks/txs/decodedInputData.ts
+43
-0
viewports.ts
playwright/viewports.ts
+3
-0
TxDecodedInputData.pw.tsx
ui/tx/TxDecodedInputData/TxDecodedInputData.pw.tsx
+70
-0
TxDecodedInputData.tsx
ui/tx/TxDecodedInputData/TxDecodedInputData.tsx
+0
-0
TxDecodedInputData.pw.tsx_desktop-dark-color-mode-1.png
..._/TxDecodedInputData.pw.tsx_desktop-dark-color-mode-1.png
+0
-0
TxDecodedInputData.pw.tsx_desktop-with-indexed-fields-1.png
...DecodedInputData.pw.tsx_desktop-with-indexed-fields-1.png
+0
-0
TxDecodedInputData.pw.tsx_desktop-without-indexed-fields-1.png
...odedInputData.pw.tsx_desktop-without-indexed-fields-1.png
+0
-0
TxDecodedInputData.pw.tsx_mobile-dark-color-mode-1.png
...__/TxDecodedInputData.pw.tsx_mobile-dark-color-mode-1.png
+0
-0
TxDecodedInputData.pw.tsx_mobile-with-indexed-fields-1.png
...xDecodedInputData.pw.tsx_mobile-with-indexed-fields-1.png
+0
-0
TxDecodedInputData.pw.tsx_mobile-without-indexed-fields-1.png
...codedInputData.pw.tsx_mobile-without-indexed-fields-1.png
+0
-0
TxDetails.tsx
ui/tx/TxDetails.tsx
+1
-1
TxRevertReason.tsx
ui/tx/details/TxRevertReason.tsx
+1
-1
TxLogItem.tsx
ui/tx/logs/TxLogItem.tsx
+1
-1
No files found.
.eslintrc.js
View file @
c28d5020
...
...
@@ -195,7 +195,7 @@ module.exports = {
groups
:
[
'
module
'
,
'
/types/
'
,
[
'
/^configs/
'
,
'
/^data/
'
,
'
/^deploy/
'
,
'
/^icons/
'
,
'
/^lib/
'
,
'
/^pages/
'
,
'
/^playwright/
'
,
'
/^theme/
'
,
'
/^ui/
'
],
[
'
/^configs/
'
,
'
/^data/
'
,
'
/^deploy/
'
,
'
/^icons/
'
,
'
/^lib/
'
,
'
/^
mocks/
'
,
'
/^
pages/
'
,
'
/^playwright/
'
,
'
/^theme/
'
,
'
/^ui/
'
],
[
'
parent
'
,
'
sibling
'
,
'
index
'
],
],
alphabetize
:
{
order
:
'
asc
'
,
ignoreCase
:
true
},
...
...
mocks/txs/decodedInputData.ts
0 → 100644
View file @
c28d5020
import
type
{
DecodedInput
}
from
'
types/api/decodedInput
'
;
export
const
withoutIndexedFields
:
DecodedInput
=
{
method_call
:
'
CreditSpended(uint256 _type, uint256 _quantity)
'
,
method_id
:
'
58cdf94a
'
,
parameters
:
[
{
name
:
'
_type
'
,
type
:
'
uint256
'
,
value
:
'
3
'
,
},
{
name
:
'
_quantity
'
,
type
:
'
uint256
'
,
value
:
'
1
'
,
},
],
};
export
const
withIndexedFields
:
DecodedInput
=
{
method_call
:
'
Transfer(address indexed from, address indexed to, uint256 value)
'
,
method_id
:
'
ddf252ad
'
,
parameters
:
[
{
indexed
:
true
,
name
:
'
from
'
,
type
:
'
address
'
,
value
:
'
0xd789a607ceac2f0e14867de4eb15b15c9ffb5859
'
,
},
{
indexed
:
true
,
name
:
'
to
'
,
type
:
'
address
'
,
value
:
'
0x7d20a8d54f955b4483a66ab335635ab66e151c51
'
,
},
{
indexed
:
false
,
name
:
'
value
'
,
type
:
'
uint256
'
,
value
:
'
31567373703130350
'
,
},
],
};
playwright/viewports.ts
0 → 100644
View file @
c28d5020
export
const
DESKTOP
=
{
width
:
1000
,
height
:
625
};
export
const
MOBILE
=
{
width
:
390
,
height
:
844
};
ui/tx/TxDecodedInputData/TxDecodedInputData.pw.tsx
0 → 100644
View file @
c28d5020
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
mocks
from
'
mocks/txs/decodedInputData
'
;
import
RenderWithChakra
from
'
playwright/RenderWithChakra
'
;
import
{
DESKTOP
,
MOBILE
}
from
'
playwright/viewports
'
;
import
TxDecodedInputData
from
'
./TxDecodedInputData
'
;
test
.
describe
(
'
desktop
'
,
()
=>
{
test
.
use
({
viewport
:
DESKTOP
});
test
(
'
dark color mode
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
colorMode=
"dark"
>
<
TxDecodedInputData
data=
{
mocks
.
withIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
with indexed fields
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxDecodedInputData
data=
{
mocks
.
withIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
without indexed fields
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxDecodedInputData
data=
{
mocks
.
withoutIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
});
test
.
describe
(
'
mobile
'
,
()
=>
{
test
.
use
({
viewport
:
MOBILE
});
test
(
'
dark color mode
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
colorMode=
"dark"
>
<
TxDecodedInputData
data=
{
mocks
.
withIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
with indexed fields
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxDecodedInputData
data=
{
mocks
.
withIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
without indexed fields
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
TxDecodedInputData
data=
{
mocks
.
withoutIndexedFields
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
});
ui/tx/TxDecodedInputData.tsx
→
ui/tx/TxDecodedInputData
/TxDecodedInputData
.tsx
View file @
c28d5020
File moved
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_desktop-dark-color-mode-1.png
0 → 100644
View file @
c28d5020
27 KB
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_desktop-with-indexed-fields-1.png
0 → 100644
View file @
c28d5020
26.9 KB
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_desktop-without-indexed-fields-1.png
0 → 100644
View file @
c28d5020
15.9 KB
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_mobile-dark-color-mode-1.png
0 → 100644
View file @
c28d5020
22.8 KB
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_mobile-with-indexed-fields-1.png
0 → 100644
View file @
c28d5020
22.7 KB
ui/tx/TxDecodedInputData/__screenshots__/TxDecodedInputData.pw.tsx_mobile-without-indexed-fields-1.png
0 → 100644
View file @
c28d5020
15 KB
ui/tx/TxDetails.tsx
View file @
c28d5020
...
...
@@ -27,7 +27,7 @@ import Utilization from 'ui/shared/Utilization/Utilization';
import
TxDetailsSkeleton
from
'
ui/tx/details/TxDetailsSkeleton
'
;
import
TxDetailsTokenTransfers
from
'
ui/tx/details/TxDetailsTokenTransfers
'
;
import
TxRevertReason
from
'
ui/tx/details/TxRevertReason
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
/TxDecodedInputData
'
;
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
import
useFetchTxInfo
from
'
ui/tx/useFetchTxInfo
'
;
...
...
ui/tx/details/TxRevertReason.tsx
View file @
c28d5020
...
...
@@ -3,7 +3,7 @@ import React from 'react';
import
type
{
TransactionRevertReason
}
from
'
types/api/transaction
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
/TxDecodedInputData
'
;
type
Props
=
TransactionRevertReason
;
...
...
ui/tx/logs/TxLogItem.tsx
View file @
c28d5020
...
...
@@ -10,7 +10,7 @@ import Address from 'ui/shared/address/Address';
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
TxLogTopic
from
'
ui/tx/logs/TxLogTopic
'
;
import
DecodedInputData
from
'
ui/tx/TxDecodedInputData
'
;
import
DecodedInputData
from
'
ui/tx/TxDecodedInputData
/TxDecodedInputData
'
;
type
Props
=
Log
;
...
...
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