forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const DESKTOP = { width: 1000, height: 625 }; | ||
|
||
export const DESKTOP_XL = { width: 1440, height: 900 }; | ||
export const MOBILE = { width: 390, height: 844 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
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(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+59.1 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_desktop-dark-color-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.3 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_desktop-with-decoded-input-data-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.5 KB
.../logs/__screenshots__/TxLogItem.pw.tsx_desktop-without-decoded-input-data-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_mobile-dark-color-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.3 KB
ui/tx/logs/__screenshots__/TxLogItem.pw.tsx_mobile-with-decoded-input-data-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.8 KB
...x/logs/__screenshots__/TxLogItem.pw.tsx_mobile-without-decoded-input-data-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.