diff --git a/mocks/search/index.ts b/mocks/search/index.ts index 199a02d7cc..04a16dc730 100644 --- a/mocks/search/index.ts +++ b/mocks/search/index.ts @@ -7,6 +7,7 @@ export const token1: SearchResultToken = { symbol: 'TNT', token_url: '/token/0x377c5F2B300B25a534d4639177873b7fEAA56d4B', type: 'token' as const, + icon_url: 'http://localhost:3000/token-icon.png', }; export const token2: SearchResultToken = { @@ -16,6 +17,7 @@ export const token2: SearchResultToken = { symbol: 'pdE1B', token_url: '/token/0xC35Cc7223B0175245E9964f2E3119c261E8e21F9', type: 'token' as const, + icon_url: null, }; export const block1: SearchResultBlock = { diff --git a/mocks/tokens/tokenInfo.ts b/mocks/tokens/tokenInfo.ts index 5358627d6a..c2e5e520aa 100644 --- a/mocks/tokens/tokenInfo.ts +++ b/mocks/tokens/tokenInfo.ts @@ -10,7 +10,7 @@ export const tokenInfo: TokenInfo = { symbol: 'ARIA', type: 'ERC-20', total_supply: '1235', - icon_url: null, + icon_url: 'http://localhost:3000/token-icon.png', }; export const tokenCounters: TokenCounters = { diff --git a/stubs/search.ts b/stubs/search.ts index 31c743d136..4cab9c325b 100644 --- a/stubs/search.ts +++ b/stubs/search.ts @@ -9,6 +9,7 @@ export const SEARCH_RESULT_ITEM: SearchResultItem = { symbol: 'USDC', token_url: '/token/0x3714A8C7824B22271550894f7555f0a672f97809', type: 'token', + icon_url: null, }; export const SEARCH_RESULT_NEXT_PAGE_PARAMS: SearchResult['next_page_params'] = { diff --git a/types/api/search.ts b/types/api/search.ts index 1017b5087d..5dcc7512b3 100644 --- a/types/api/search.ts +++ b/types/api/search.ts @@ -7,6 +7,7 @@ export interface SearchResultToken { address: string; token_url: string; address_url: string; + icon_url: string | null; } export interface SearchResultAddressOrContract { diff --git a/ui/pages/SearchResults.pw.tsx b/ui/pages/SearchResults.pw.tsx index adf3f46a82..0a60ab81b8 100644 --- a/ui/pages/SearchResults.pw.tsx +++ b/ui/pages/SearchResults.pw.tsx @@ -23,6 +23,12 @@ test('search by name +@mobile +@dark-mode', async({ mount, page }) => { ], }), })); + await page.route(searchMock.token1.icon_url as string, (route) => { + return route.fulfill({ + status: 200, + path: './playwright/image_s.jpg', + }); + }); const component = await mount( diff --git a/ui/pages/Token.pw.tsx b/ui/pages/Token.pw.tsx index e239108c85..17803b06ba 100644 --- a/ui/pages/Token.pw.tsx +++ b/ui/pages/Token.pw.tsx @@ -76,6 +76,12 @@ test('with verified info', async({ mount, page, createSocket }) => { await page.route(VERIFIED_INFO_URL, (route) => route.fulfill({ body: JSON.stringify(verifiedAddressesMocks.TOKEN_INFO_APPLICATION.APPROVED), })); + await page.route(tokenInfo.icon_url as string, (route) => { + return route.fulfill({ + status: 200, + path: './playwright/image_s.jpg', + }); + }); const component = await mount( @@ -119,6 +125,12 @@ test.describe('mobile', () => { await page.route(VERIFIED_INFO_URL, (route) => route.fulfill({ body: JSON.stringify(verifiedAddressesMocks.TOKEN_INFO_APPLICATION.APPROVED), })); + await page.route(tokenInfo.icon_url as string, (route) => { + return route.fulfill({ + status: 200, + path: './playwright/image_s.jpg', + }); + }); const component = await mount( diff --git a/ui/pages/__screenshots__/SearchResults.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png b/ui/pages/__screenshots__/SearchResults.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png index 51c4fe9eae..c64f3bbcd6 100644 Binary files a/ui/pages/__screenshots__/SearchResults.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/SearchResults.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-name-mobile-dark-mode-1.png b/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-name-mobile-dark-mode-1.png index 334f35b4c8..902be2754f 100644 Binary files a/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-name-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-name-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png b/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png index 0b2905aa10..11798e5d9f 100644 Binary files a/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png b/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png index bdcce941ef..5a94c5942d 100644 Binary files a/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png and b/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png differ diff --git a/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png b/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png index 470ff8f7cb..835691ee56 100644 Binary files a/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png and b/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png differ diff --git a/ui/searchResults/SearchResultListItem.tsx b/ui/searchResults/SearchResultListItem.tsx index a827fa0cd1..5f9e15dca3 100644 --- a/ui/searchResults/SearchResultListItem.tsx +++ b/ui/searchResults/SearchResultListItem.tsx @@ -31,7 +31,7 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => { return ( - + { switch (data.type) { case 'token': { const name = data.name + (data.symbol ? ` (${ trimTokenSymbol(data.symbol) })` : ''); + return ( <> - + { path: './playwright/image_s.jpg', }); }); + await page.route(searchMock.token1.icon_url as string, (route) => { + return route.fulfill({ + status: 200, + path: './playwright/image_s.jpg', + }); + }); }); test('search by name +@mobile +@dark-mode', async({ mount, page }) => { diff --git a/ui/snippets/searchBar/SearchBarSuggestItem.tsx b/ui/snippets/searchBar/SearchBarSuggestItem.tsx index 57b6626e13..38bf1cd81f 100644 --- a/ui/snippets/searchBar/SearchBarSuggestItem.tsx +++ b/ui/snippets/searchBar/SearchBarSuggestItem.tsx @@ -47,7 +47,7 @@ const SearchBarSuggestItem = ({ data, isMobile, searchTerm, onClick }: Props) => return ( <> - + diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png index 87607e2010..e0c427e73c 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-name-mobile-dark-mode-1.png differ diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-name-mobile-dark-mode-1.png index 666634ae0d..d299bddd78 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-name-mobile-dark-mode-1.png differ diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png index 8a68621f4f..7f6b13835e 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-name-mobile-dark-mode-1.png differ