Skip to content

refactor: asset picker and token list generators #33525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/e2e/tests/bridge/bridge-positive-cases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ describe('Bridge tests', function (this: Suite) {
'24.9',
);

const getHeapSize = async () =>
(await driver.executeScript(
'return window.performance.memory.usedJSHeapSize/1024/1024',
)) as number;

const heapSizeBefore = await getHeapSize();

// Switch to Linea Mainnet to set it as the selected network
// in the network-controller
await switchToNetworkFlow(driver, 'Linea Mainnet');
Expand Down Expand Up @@ -66,6 +73,12 @@ describe('Bridge tests', function (this: Suite) {
'22.9',
);

const heapSizeAfter1 = await getHeapSize();
console.log('heapSizeBefore', heapSizeBefore);
console.log('heapSizeAfter1', heapSizeAfter1);

expect(heapSizeAfter1 - heapSizeBefore).toBeLessThanOrEqual(1000);

// Switch to Arbitrum One to set it as the selected network
// in the network-controller
await searchAndSwitchToNetworkFlow(driver, 'Arbitrum One');
Expand All @@ -83,6 +96,10 @@ describe('Bridge tests', function (this: Suite) {
6,
'22.9',
);

const heapSizeAfter2 = await getHeapSize();
console.log('heapSizeAfter2', heapSizeAfter2);
expect(heapSizeAfter2 - heapSizeBefore).toBeLessThanOrEqual(1000);
},
);
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/webdriver/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ChromeDriver {
'--disable-features=OptimizationGuideModelDownloading,OptimizationHintsFetching,OptimizationTargetPrediction,OptimizationHints,NetworkTimeServiceQuerying', // Stop chrome from calling home so much (auto-downloads of AI models; time sync)
'--disable-component-update', // Stop chrome from calling home so much (auto-update)
'--disable-dev-shm-usage',
'--js-flags=--expose-gc',
];

if (process.env.MULTIPROVIDER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ export type PreviouslyOwnedCollections = {
type AssetPickerModalNftTabProps = {
searchQuery: string;
onClose: () => void;
renderSearch: () => void;
};

export function AssetPickerModalNftTab({
searchQuery,
onClose,
renderSearch,
}: AssetPickerModalNftTabProps) {
const t = useI18nContext();
const dispatch = useDispatch();
Expand Down Expand Up @@ -134,7 +132,6 @@ export function AssetPickerModalNftTab({

return (
<Box className="modal-tab__main-view">
{renderSearch()}
{hasAnyNfts ? (
<>
<Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { useI18nContext } from '../../../../hooks/useI18nContext';
* @param props.isNFTSearch - Indicates if the search is for NFTs.
* @param props.props - Additional props for the containing Box component.
* @param props.placeholder - A custom placeholder for the search input.
* @param props.autoFocus
* @returns The rendered search component.
*/
export const Search = ({
Expand All @@ -29,14 +28,12 @@ export const Search = ({
isNFTSearch = false,
props,
placeholder,
autoFocus = true,
}: {
searchQuery: string;
onChange: (value: string) => void;
isNFTSearch?: boolean;
props?: React.ComponentProps<typeof Box>;
placeholder?: JSX.Element | string | null;
autoFocus?: boolean;
}) => {
const t = useI18nContext();

Expand All @@ -57,7 +54,7 @@ export const Search = ({
value={searchQuery}
onChange={(e) => onChange(e.target.value)}
error={false}
autoFocus={autoFocus}
autoFocus
autoComplete={false}
width={BlockSize.Full}
clearButtonOnClick={() => onChange('')}
Expand Down
Loading
Loading