Skip to content

Commit

Permalink
Merge branch 'main' into refactor/use-new-accounts-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
gantunesr authored Dec 17, 2024
2 parents 90050b9 + da16971 commit 79dad4d
Show file tree
Hide file tree
Showing 89 changed files with 702 additions and 501 deletions.
5 changes: 4 additions & 1 deletion app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/scripts/controllers/permissions/background-api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import nanoid from 'nanoid';
import { nanoid } from 'nanoid';
import {
CaveatTypes,
RestrictedMethods,
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { rawChainData } from 'eth-chainlist';
import { MetaMaskKeyring as QRHardwareKeyring } from '@keystonehq/metamask-airgapped-keyring';
import EthQuery from '@metamask/eth-query';
import EthJSQuery from '@metamask/ethjs-query';
import nanoid from 'nanoid';
import { nanoid } from 'nanoid';
import { captureException } from '@sentry/browser';
import { AddressBookController } from '@metamask/address-book-controller';
import {
Expand Down
14 changes: 6 additions & 8 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
"@metamask/rpc-errors": true
"@metamask/rpc-errors": true,
"nanoid": true
}
},
"@metamask/approval-controller>nanoid": {
Expand Down Expand Up @@ -1970,11 +1970,11 @@
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/json-rpc-engine": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"immer": true
"immer": true,
"nanoid": true
}
},
"@metamask/permission-controller>nanoid": {
Expand Down Expand Up @@ -2434,7 +2434,6 @@
"@metamask/snaps-controllers>@xstate/fsm": true,
"@metamask/snaps-controllers>concat-stream": true,
"@metamask/snaps-controllers>get-npm-tarball-url": true,
"@metamask/snaps-controllers>nanoid": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-rpc-methods": true,
Expand All @@ -2445,6 +2444,7 @@
"browserify>browserify-zlib": true,
"eslint>fast-deep-equal": true,
"immer": true,
"nanoid": true,
"readable-stream": true,
"semver": true
}
Expand Down Expand Up @@ -4502,9 +4502,7 @@
},
"nanoid": {
"globals": {
"crypto": true,
"msCrypto": true,
"navigator": true
"crypto.getRandomValues": true
}
},
"nock>debug": {
Expand Down
14 changes: 6 additions & 8 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
"@metamask/rpc-errors": true
"@metamask/rpc-errors": true,
"nanoid": true
}
},
"@metamask/approval-controller>nanoid": {
Expand Down Expand Up @@ -1970,11 +1970,11 @@
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/json-rpc-engine": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"immer": true
"immer": true,
"nanoid": true
}
},
"@metamask/permission-controller>nanoid": {
Expand Down Expand Up @@ -2434,7 +2434,6 @@
"@metamask/snaps-controllers>@xstate/fsm": true,
"@metamask/snaps-controllers>concat-stream": true,
"@metamask/snaps-controllers>get-npm-tarball-url": true,
"@metamask/snaps-controllers>nanoid": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-rpc-methods": true,
Expand All @@ -2445,6 +2444,7 @@
"browserify>browserify-zlib": true,
"eslint>fast-deep-equal": true,
"immer": true,
"nanoid": true,
"readable-stream": true,
"semver": true
}
Expand Down Expand Up @@ -4502,9 +4502,7 @@
},
"nanoid": {
"globals": {
"crypto": true,
"msCrypto": true,
"navigator": true
"crypto.getRandomValues": true
}
},
"nock>debug": {
Expand Down
14 changes: 6 additions & 8 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
"@metamask/rpc-errors": true
"@metamask/rpc-errors": true,
"nanoid": true
}
},
"@metamask/approval-controller>nanoid": {
Expand Down Expand Up @@ -1970,11 +1970,11 @@
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/json-rpc-engine": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"immer": true
"immer": true,
"nanoid": true
}
},
"@metamask/permission-controller>nanoid": {
Expand Down Expand Up @@ -2434,7 +2434,6 @@
"@metamask/snaps-controllers>@xstate/fsm": true,
"@metamask/snaps-controllers>concat-stream": true,
"@metamask/snaps-controllers>get-npm-tarball-url": true,
"@metamask/snaps-controllers>nanoid": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-rpc-methods": true,
Expand All @@ -2445,6 +2444,7 @@
"browserify>browserify-zlib": true,
"eslint>fast-deep-equal": true,
"immer": true,
"nanoid": true,
"readable-stream": true,
"semver": true
}
Expand Down Expand Up @@ -4502,9 +4502,7 @@
},
"nanoid": {
"globals": {
"crypto": true,
"msCrypto": true,
"navigator": true
"crypto.getRandomValues": true
}
},
"nock>debug": {
Expand Down
14 changes: 6 additions & 8 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
"@metamask/rpc-errors": true
"@metamask/rpc-errors": true,
"nanoid": true
}
},
"@metamask/approval-controller>nanoid": {
Expand Down Expand Up @@ -2062,11 +2062,11 @@
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/json-rpc-engine": true,
"@metamask/permission-controller>nanoid": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"deep-freeze-strict": true,
"immer": true
"immer": true,
"nanoid": true
}
},
"@metamask/permission-controller>nanoid": {
Expand Down Expand Up @@ -2526,7 +2526,6 @@
"@metamask/snaps-controllers>@xstate/fsm": true,
"@metamask/snaps-controllers>concat-stream": true,
"@metamask/snaps-controllers>get-npm-tarball-url": true,
"@metamask/snaps-controllers>nanoid": true,
"@metamask/snaps-controllers>readable-web-to-node-stream": true,
"@metamask/snaps-controllers>tar-stream": true,
"@metamask/snaps-rpc-methods": true,
Expand All @@ -2537,6 +2536,7 @@
"browserify>browserify-zlib": true,
"eslint>fast-deep-equal": true,
"immer": true,
"nanoid": true,
"readable-stream": true,
"semver": true
}
Expand Down Expand Up @@ -4594,9 +4594,7 @@
},
"nanoid": {
"globals": {
"crypto": true,
"msCrypto": true,
"navigator": true
"crypto.getRandomValues": true
}
},
"nock>debug": {
Expand Down
2 changes: 1 addition & 1 deletion lavamoat/build-system/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6510,7 +6510,7 @@
"process.env.NODE_ENV": true
},
"packages": {
"postcss>nanoid": true,
"nanoid": true,
"postcss>picocolors": true,
"postcss>source-map-js": true
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"loglevel": "^1.8.1",
"lottie-web": "^5.12.2",
"luxon": "^3.2.1",
"nanoid": "^2.1.6",
"nanoid": "^3.3.8",
"pify": "^5.0.0",
"promise-to-callback": "^1.0.0",
"prop-types": "^15.6.1",
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/page-objects/pages/account-list-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ class AccountListPage {
});
}

/**
* Verifies that all occurrences of the account balance value and symbol are displayed as private.
*
*/
async check_balanceIsPrivateEverywhere(): Promise<void> {
console.log(`Verify all account balance occurrences are private`);
const balanceSelectors = {
tag: 'span',
text: '••••••',
};
await this.driver.elementCountBecomesN(balanceSelectors, 6);
}

async check_currentAccountIsImported(): Promise<void> {
console.log(`Check that current account is an imported account`);
await this.driver.waitForSelector({
Expand Down
19 changes: 12 additions & 7 deletions test/e2e/page-objects/pages/header-navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ class HeaderNavbar {
await this.driver.clickElement(this.switchNetworkDropDown);
}

async check_currentSelectedNetwork(networkName: string): Promise<void> {
console.log(`Validate the Switch network to ${networkName}`);
await this.driver.waitForSelector(
`button[data-testid="network-display"][aria-label="Network Menu ${networkName}"]`,
);
}

/**
* Verifies that the displayed account label in header matches the expected label.
*
Expand All @@ -101,6 +94,18 @@ class HeaderNavbar {
text: expectedLabel,
});
}

/**
* Validates that the currently selected network matches the expected network name.
*
* @param networkName - The expected name of the currently selected network.
*/
async check_currentSelectedNetwork(networkName: string): Promise<void> {
console.log(`Validate the Switch network to ${networkName}`);
await this.driver.waitForSelector(
`button[data-testid="network-display"][aria-label="Network Menu ${networkName}"]`,
);
}
}

export default HeaderNavbar;
37 changes: 29 additions & 8 deletions test/e2e/page-objects/pages/home/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class HomePage {

public headerNavbar: HeaderNavbar;

private readonly activityTab =
'[data-testid="account-overview__activity-tab"]';
private readonly activityTab = {
testId: 'account-overview__activity-tab',
};

private readonly balance = '[data-testid="eth-overview__primary-currency"]';

Expand All @@ -23,19 +24,35 @@ class HomePage {
tag: 'h6',
};

private readonly erc20TokenDropdown = '[data-testid="import-token-button"]';
private readonly erc20TokenDropdown = {
testId: 'import-token-button',
};

private readonly nftTab = '[data-testid="account-overview__nfts-tab"]';
private readonly nftTab = {
testId: 'account-overview__nfts-tab',
};

private readonly popoverBackground = '.popover-bg';

private readonly popoverCloseButton = '[data-testid="popover-close"]';
private readonly popoverCloseButton = {
testId: 'popover-close',
};

private readonly refreshErc20Tokens = '[data-testid="refreshList"]';
private readonly privacyBalanceToggle = {
testId: 'sensitive-toggle',
};

private readonly sendButton = '[data-testid="eth-overview-send"]';
private readonly refreshErc20Tokens = {
testId: 'refreshList',
};

private readonly tokensTab = '[data-testid="account-overview__asset-tab"]';
private readonly sendButton = {
testId: 'eth-overview-send',
};

private readonly tokensTab = {
testId: 'account-overview__asset-tab',
};

constructor(driver: Driver) {
this.driver = driver;
Expand Down Expand Up @@ -93,6 +110,10 @@ class HomePage {
await this.driver.clickElement(this.sendButton);
}

async togglePrivacyBalance(): Promise<void> {
await this.driver.clickElement(this.privacyBalanceToggle);
}

/**
* Checks if the toaster message for adding a network is displayed on the homepage.
*
Expand Down
Loading

0 comments on commit 79dad4d

Please sign in to comment.