-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2153 from blockscout/ens-in-wallet-menu
Display ENS on the wallet button and in the menu
- Loading branch information
Showing
27 changed files
with
247 additions
and
11 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
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 modified
BIN
+2.84 KB
(120%)
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_submenu-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 modified
BIN
+3.13 KB
(110%)
...s__/NavigationDesktop.pw.tsx_default_with-highlighted-routes-with-submenu-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 modified
BIN
+3.21 KB
(110%)
...on/vertical/__screenshots__/NavigationDesktop.pw.tsx_default_with-submenu-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 modified
BIN
+3.24 KB
(110%)
...l/__screenshots__/NavigationDesktop.pw.tsx_default_with-submenu-xl-screen-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,70 @@ | ||
import React from 'react'; | ||
|
||
import type * as bens from '@blockscout/bens-types'; | ||
|
||
import config from 'configs/app'; | ||
import * as addressMock from 'mocks/address/address'; | ||
import * as domainMock from 'mocks/ens/domain'; | ||
import { test, expect } from 'playwright/lib'; | ||
|
||
import { WalletMenuDesktop } from './WalletMenuDesktop'; | ||
|
||
const props = { | ||
isWalletConnected: false, | ||
address: '', | ||
connect: () => {}, | ||
disconnect: () => {}, | ||
isModalOpening: false, | ||
isModalOpen: false, | ||
openModal: () => {}, | ||
}; | ||
|
||
test.use({ viewport: { width: 1440, height: 750 } }); // xl | ||
|
||
test('wallet is not connected +@dark-mode', async({ page, render }) => { | ||
await render(<WalletMenuDesktop { ...props }/>); | ||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 50 } }); | ||
}); | ||
|
||
test('wallet is not connected (home page) +@dark-mode', async({ page, render }) => { | ||
await render(<WalletMenuDesktop { ...props } isHomePage/>); | ||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 50 } }); | ||
}); | ||
|
||
test('wallet is loading', async({ page, render }) => { | ||
await render(<WalletMenuDesktop { ...props } isModalOpen/>); | ||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 50 } }); | ||
}); | ||
|
||
test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) => { | ||
await mockApiResponse( | ||
'address_domain', | ||
{ domain: undefined, resolved_domains_count: 0 } as bens.GetAddressResponse, | ||
{ pathParams: { address: addressMock.hash, chainId: config.chain.id } }, | ||
); | ||
|
||
const component = await render(<WalletMenuDesktop { ...props } isWalletConnected address={ addressMock.hash }/>); | ||
await component.locator('button').click(); | ||
|
||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 300 } }); | ||
}); | ||
|
||
test('wallet connected (home page) +@dark-mode', async({ page, render }) => { | ||
const component = await render(<WalletMenuDesktop { ...props } isHomePage isWalletConnected address={ addressMock.hash }/>); | ||
await component.locator('button').click(); | ||
|
||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 300 } }); | ||
}); | ||
|
||
test('wallet with ENS connected', async({ page, render, mockApiResponse }) => { | ||
await mockApiResponse( | ||
'address_domain', | ||
{ domain: domainMock.ensDomainB, resolved_domains_count: 1 } as bens.GetAddressResponse, | ||
{ pathParams: { address: addressMock.hash, chainId: config.chain.id } }, | ||
); | ||
|
||
const component = await render(<WalletMenuDesktop { ...props } isWalletConnected address={ addressMock.hash }/>); | ||
await component.locator('button').click(); | ||
|
||
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 250, height: 300 } }); | ||
}); |
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,58 @@ | ||
import React from 'react'; | ||
|
||
import type * as bens from '@blockscout/bens-types'; | ||
|
||
import config from 'configs/app'; | ||
import * as addressMock from 'mocks/address/address'; | ||
import * as domainMock from 'mocks/ens/domain'; | ||
import { test, expect, devices } from 'playwright/lib'; | ||
|
||
import { WalletMenuMobile } from './WalletMenuMobile'; | ||
|
||
const props = { | ||
isWalletConnected: false, | ||
address: '', | ||
connect: () => {}, | ||
disconnect: () => {}, | ||
isModalOpening: false, | ||
isModalOpen: false, | ||
openModal: () => {}, | ||
}; | ||
|
||
test.use({ viewport: devices['iPhone 13 Pro'].viewport }); | ||
|
||
test('wallet is not connected +@dark-mode', async({ page, render }) => { | ||
await render(<WalletMenuMobile { ...props }/>); | ||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('wallet is loading', async({ page, render }) => { | ||
await render(<WalletMenuMobile { ...props } isModalOpen/>); | ||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) => { | ||
await mockApiResponse( | ||
'address_domain', | ||
{ domain: undefined, resolved_domains_count: 0 } as bens.GetAddressResponse, | ||
{ pathParams: { address: addressMock.hash, chainId: config.chain.id } }, | ||
); | ||
|
||
const component = await render(<WalletMenuMobile { ...props } isWalletConnected address={ addressMock.hash }/>); | ||
await component.locator('button').click(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('wallet with ENS connected', async({ page, render, mockApiResponse }) => { | ||
await mockApiResponse( | ||
'address_domain', | ||
{ domain: domainMock.ensDomainB, resolved_domains_count: 1 } as bens.GetAddressResponse, | ||
{ pathParams: { address: addressMock.hash, chainId: config.chain.id } }, | ||
); | ||
|
||
const component = await render(<WalletMenuMobile { ...props } isWalletConnected address={ addressMock.hash }/>); | ||
await component.locator('button').click(); | ||
|
||
await expect(page).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
+16.3 KB
...ots__/WalletMenuDesktop.pw.tsx_dark-color-mode_wallet-connected-dark-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
+16.5 KB
...etMenuDesktop.pw.tsx_dark-color-mode_wallet-connected-home-page-dark-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
+2.43 KB
...alletMenuDesktop.pw.tsx_dark-color-mode_wallet-is-not-connected-dark-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
+2.23 KB
...esktop.pw.tsx_dark-color-mode_wallet-is-not-connected-home-page-dark-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
+16 KB
...screenshots__/WalletMenuDesktop.pw.tsx_default_wallet-connected-dark-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
+16.1 KB
...s__/WalletMenuDesktop.pw.tsx_default_wallet-connected-home-page-dark-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
+2.09 KB
...etMenu/__screenshots__/WalletMenuDesktop.pw.tsx_default_wallet-is-loading-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
+2.32 KB
...hots__/WalletMenuDesktop.pw.tsx_default_wallet-is-not-connected-dark-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
+2.21 KB
...letMenuDesktop.pw.tsx_default_wallet-is-not-connected-home-page-dark-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
+14.4 KB
..._screenshots__/WalletMenuDesktop.pw.tsx_default_wallet-with-ENS-connected-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
+16.2 KB
...hots__/WalletMenuMobile.pw.tsx_dark-color-mode_wallet-connected-dark-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
+3.59 KB
...WalletMenuMobile.pw.tsx_dark-color-mode_wallet-is-not-connected-dark-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
+15.6 KB
..._screenshots__/WalletMenuMobile.pw.tsx_default_wallet-connected-dark-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
+3.09 KB
...letMenu/__screenshots__/WalletMenuMobile.pw.tsx_default_wallet-is-loading-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
+3.56 KB
...shots__/WalletMenuMobile.pw.tsx_default_wallet-is-not-connected-dark-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
+14.2 KB
...__screenshots__/WalletMenuMobile.pw.tsx_default_wallet-with-ENS-connected-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.