Skip to content

Commit

Permalink
Merge branch 'develop' into olu/test-scenario-eth-sign
Browse files Browse the repository at this point in the history
  • Loading branch information
segun authored Mar 12, 2024
2 parents 564e263 + 6e397d0 commit 0dd6eb8
Show file tree
Hide file tree
Showing 87 changed files with 459 additions and 180 deletions.
29 changes: 29 additions & 0 deletions app/_locales/en/messages.json

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

Binary file added app/images/portfolio-v2-whatsnew-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions shared/notifications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const NOTIFICATION_U2F_LEDGER_LIVE = 28;
export const NOTIFICATION_BLOCKAID_DEFAULT = 29;
export const NOTIFICATION_STAKING_PORTFOLIO = 30;
export const NOTIFICATION_PETNAMES = 31;
export const NOTIFICATION_PORTFOLIO_V2 = 32;

export const UI_NOTIFICATIONS = {
8: {
Expand Down Expand Up @@ -72,6 +73,14 @@ export const UI_NOTIFICATIONS = {
width: '100%',
},
},
[NOTIFICATION_PORTFOLIO_V2]: {
id: Number(NOTIFICATION_PORTFOLIO_V2),
date: null,
image: {
src: 'images/portfolio-v2-whatsnew-banner.png',
width: '100%',
},
},
};

export const getTranslatedUINotifications = (
Expand Down Expand Up @@ -212,5 +221,16 @@ export const getTranslatedUINotifications = (
actionText: t('notificationsPetnamesActionText'),
date: '',
},
[NOTIFICATION_PORTFOLIO_V2]: {
...UI_NOTIFICATIONS[NOTIFICATION_PORTFOLIO_V2],
title: t('notificationsPortfolioV2Title'),
description: [
t('notificationsPortfolioV2DescriptionOne'),
t('notificationsPortfolioV2DescriptionTwo'),
t('notificationsPortfolioV2DescriptionThree'),
],
actionText: t('notificationsPortfolioV2ActionText'),
date: '',
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const {
unlockWallet,
WALLET_PASSWORD,
waitForAccountRendered,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { emptyHtmlPage } = require('../mock-e2e');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { emptyHtmlPage } = require('../../mock-e2e');

const ganacheOptions = {
accounts: [
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('Import flow @no-mmi', function () {
const fileInput = await driver.findElement('input[type="file"]');
const importJsonFile = path.join(
__dirname,
'..',
'../..',
'import-utc-json',
'test-json-import-account-file.json',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const {
defaultGanacheOptions,
withFixtures,
unlockWallet,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const { SMART_CONTRACTS } = require('../../seeder/smart-contracts');
const FixtureBuilder = require('../../fixture-builder');

describe('Block Explorer', function () {
it('links to the users account on the explorer, ', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const {
unlockWallet,
WINDOW_TITLES,
generateGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Dapp interactions', function () {
it('should trigger the add chain confirmation despite MetaMask being locked', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const { SMART_CONTRACTS } = require('../../seeder/smart-contracts');
const FixtureBuilder = require('../../fixture-builder');

describe('Editing confirmations of dapp initiated contract interactions', function () {
const smartContract = SMART_CONTRACTS.PIGGYBANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Permissions', function () {
it('sets permissions and connect to Dapp', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const {
openDapp,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Wallet Revoke Permissions', function () {
it('should revoke eth_accounts permissions via test dapp', async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const { toHex } = require('@metamask/controller-utils');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
defaultGanacheOptions,
withFixtures,
openDapp,
regularDelayMs,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
} = require('../../helpers');

const TEST_CHAIN_ID = toHex(100);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Chain Interactions', function () {
const port = 8546;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
withFixtures,
unlockWallet,
openDapp,
WINDOW_TITLES,
} = require('../helpers');
const { CHAIN_IDS } = require('../../../shared/constants/network');
} = require('../../helpers');
const { CHAIN_IDS } = require('../../../../shared/constants/network');

describe('Deprecated networks', function () {
it('User should not find goerli network when clicking on the network selector', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const {
logInWithBalanceValidation,
openActionMenuAndStartSendFlow,
generateGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { GAS_API_BASE_URL } = require('../../../shared/constants/swaps');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { GAS_API_BASE_URL } = require('../../../../shared/constants/swaps');

describe('Gas API fallback', function () {
async function mockGasApiDown(mockServer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
withFixtures,
openDapp,
unlockWallet,
WINDOW_TITLES,
generateGanacheOptions,
} = require('../helpers');
} = require('../../helpers');

describe('Switch ethereum chain', function () {
it('should successfully change the network in response to wallet_switchEthereumChain', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const {
locateAccountBalanceDOM,
defaultGanacheOptions,
WALLET_PASSWORD,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('MetaMask onboarding @no-mmi', function () {
const wrongSeedPhrase =
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const {
withFixtures,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { TEST_SNAPS_WEBSITE_URL } = require('../snaps/enums');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { TEST_SNAPS_WEBSITE_URL } = require('../../snaps/enums');
const {
expectName,
focusTestDapp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
unlockWallet,
defaultGanacheOptions,
openActionMenuAndStartSendFlow,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const {
expectName,
focusTestDapp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const {
withFixtures,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { emptyHtmlPage } = require('../mock-e2e');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { emptyHtmlPage } = require('../../mock-e2e');

describe('Portfolio site', function () {
async function mockPortfolioSite(mockServer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');
const {
WINDOW_TITLES,
defaultGanacheOptions,
Expand All @@ -9,7 +9,7 @@ const {
withFixtures,
getEventPayloads,
switchToNotificationWindow,
} = require('../helpers');
} = require('../../helpers');

const selectedAddress = '0x5cfe73b6021e818b776b421b1c4db2474086a7e1';
const selectedAddressWithoutPrefix = '5cfe73b6021e818b776b421b1c4db2474086a7e1';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');
const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

async function mockInfura(mockServer) {
await mockServerJsonRpc(mockServer, [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
defaultGanacheOptions,
withFixtures,
sendScreenToConfirmScreen,
unlockWallet,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';
const mockMaliciousAddress = '0x5fbdb2315678afecb367f032d93f642f64180aa3';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Loading

0 comments on commit 0dd6eb8

Please sign in to comment.