Skip to content

Commit 4dce340

Browse files
authored
feat: Removed multichain flag for v1 release (#24362)
This PR is to remove all the Multichain flags from code except the send and swap flow ## **Related issues** Fixes: [https://github.com/MetaMask/MetaMask-planning/issues/2431](https://github.com/MetaMask/MetaMask-planning/issues/2431 ) ## **Manual testing steps** 1. Run the extension without Multichain flag. 2. All the changes should be there ## **Screenshots/Recordings** ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 8db28c7 commit 4dce340

File tree

28 files changed

+1517
-831
lines changed

28 files changed

+1517
-831
lines changed

test/e2e/accounts/common.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,15 @@ export async function connectAccountToTestDapp(driver: Driver) {
202202
export async function disconnectFromTestDapp(driver: Driver) {
203203
await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView);
204204
await driver.clickElement('[data-testid="account-options-menu-button"]');
205-
await driver.clickElement('[data-testid="global-menu-connected-sites"]');
206-
await driver.clickElement({ text: 'Disconnect', tag: 'a' });
205+
await driver.clickElement({ text: 'All Permissions', tag: 'div' });
206+
await driver.clickElement({ text: 'Got it', tag: 'button' });
207+
await driver.clickElement({
208+
text: '127.0.0.1:8080',
209+
tag: 'p',
210+
});
211+
await driver.clickElement('[data-testid="account-list-item-menu-button"]');
207212
await driver.clickElement({ text: 'Disconnect', tag: 'button' });
213+
await driver.clickElement('[data-testid ="disconnect-all"]');
208214
}
209215

210216
export async function approveOrRejectRequest(driver: Driver, flowType: string) {

test/e2e/tests/account/add-account.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,9 @@ describe('Add account', function () {
130130

131131
// Land in 1st account home page
132132
await driver.findElement('.home__main-view');
133-
134133
if (!process.env.MULTICHAIN) {
135134
await waitForAccountRendered(driver);
136135
}
137-
138136
// Check address of 1st account
139137
await driver.findElement('[data-testid="app-header-copy-button"]');
140138

test/e2e/tests/dapp-interactions/dapp-interactions.spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const {
33
defaultGanacheOptions,
44
withFixtures,
55
openDapp,
6-
DAPP_URL,
76
DAPP_ONE_URL,
87
unlockWallet,
98
WINDOW_TITLES,
@@ -84,17 +83,17 @@ describe('Dapp interactions', function () {
8483
'[data-testid ="account-options-menu-button"]',
8584
);
8685

87-
await driver.clickElement({ text: 'Connected sites', tag: 'div' });
86+
await driver.clickElement({ text: 'All Permissions', tag: 'div' });
87+
await driver.clickElement({ text: 'Got it', tag: 'button' });
8888

8989
const connectedDapp1 = await driver.isElementPresent({
90-
text: DAPP_URL,
91-
tag: 'bdi',
90+
text: '127.0.0.1:8080',
91+
tag: 'p',
9292
});
9393
const connectedDapp2 = await driver.isElementPresent({
94-
text: DAPP_ONE_URL,
95-
tag: 'bdi',
94+
text: '127.0.0.1:8081',
95+
tag: 'p',
9696
});
97-
9897
assert.ok(connectedDapp1, 'Account not connected to Dapp1');
9998
assert.ok(connectedDapp2, 'Account not connected to Dapp2');
10099
},

test/e2e/tests/dapp-interactions/permissions.spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,17 @@ describe('Permissions', function () {
5050
await driver.clickElement(
5151
'[data-testid="account-options-menu-button"]',
5252
);
53-
await driver.clickElement('.menu-item:nth-of-type(3)');
54-
55-
await driver.findElement({
56-
text: 'Connected sites',
57-
tag: 'h2',
53+
await driver.clickElement({
54+
text: 'All Permissions',
55+
tag: 'div',
5856
});
57+
await driver.clickElement({ text: 'Got it', tag: 'button' });
5958
await driver.waitForSelector({
60-
css: '.connected-sites-list__subject-name',
6159
text: '127.0.0.1:8080',
60+
tag: 'p',
6261
});
6362
const domains = await driver.findClickableElements(
64-
'.connected-sites-list__subject-name',
63+
'[data-testid="connection-list-item"]',
6564
);
6665
assert.equal(domains.length, 1);
6766

test/e2e/tests/metrics/dapp-viewed.spec.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const {
77
openDapp,
88
waitForAccountRendered,
99
WINDOW_TITLES,
10-
DAPP_URL,
1110
} = require('../../helpers');
1211
const FixtureBuilder = require('../../fixture-builder');
1312
const {
@@ -332,24 +331,35 @@ describe('Dapp viewed Event @no-mmi', function () {
332331
await driver.clickElement(
333332
'[data-testid ="account-options-menu-button"]',
334333
);
335-
await driver.clickElement({ text: 'Connected sites', tag: 'div' });
336-
await driver.findElement({
337-
text: DAPP_URL,
338-
tag: 'bdi',
334+
await driver.clickElement({
335+
text: 'All Permissions',
336+
tag: 'div',
337+
});
338+
await driver.clickElement({ text: 'Got it', tag: 'button' });
339+
await driver.clickElement({
340+
text: '127.0.0.1:8080',
341+
tag: 'p',
339342
});
340-
await driver.clickElement({ text: 'Disconnect', tag: 'a' });
343+
await driver.clickElement(
344+
'[data-testid ="account-list-item-menu-button"]',
345+
);
341346
await driver.clickElement({
342-
text: `Disconnect ${DAPP_URL}`,
343-
tag: 'h2',
347+
text: 'Disconnect',
348+
tag: 'button',
344349
});
345-
await driver.clickElement({ text: 'Disconnect', tag: 'button' });
350+
await driver.clickElement('[data-testid ="disconnect-all"]');
351+
await driver.clickElement('button[aria-label="Back"]');
352+
await driver.clickElement('button[aria-label="Back"]');
346353
// validate dapp is not connected
347354
await driver.clickElement(
348355
'[data-testid ="account-options-menu-button"]',
349356
);
350-
await driver.clickElement({ text: 'Connected sites', tag: 'div' });
357+
await driver.clickElement({
358+
text: 'All Permissions',
359+
tag: 'div',
360+
});
351361
await driver.findElement({
352-
text: 'Account 1 is not connected to any sites.',
362+
text: 'Nothing to see here',
353363
tag: 'p',
354364
});
355365
// reconnect again

test/e2e/tests/multichain/connection-page.spec.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ describe('Connections page', function () {
2020
title: this.test.fullTitle(),
2121
},
2222
async ({ driver }) => {
23-
if (!process.env.MULTICHAIN) {
24-
return;
25-
}
2623
await unlockWallet(driver);
2724
await waitForAccountRendered(driver);
2825
await connectToDapp(driver);
@@ -99,9 +96,6 @@ describe('Connections page', function () {
9996
title: this.test.fullTitle(),
10097
},
10198
async ({ driver }) => {
102-
if (!process.env.MULTICHAIN) {
103-
return;
104-
}
10599
await unlockWallet(driver);
106100
await waitForAccountRendered(driver);
107101
await connectToDapp(driver);

test/e2e/tests/multichain/permission-page.spec.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ describe('Permissions Page', function () {
1818
},
1919
async ({ driver }) => {
2020
await unlockWallet(driver);
21-
if (!process.env.MULTICHAIN) {
22-
return;
23-
}
2421
await waitForAccountRendered(driver);
2522
await connectToDapp(driver);
2623

@@ -54,9 +51,6 @@ describe('Permissions Page', function () {
5451
},
5552
async ({ driver }) => {
5653
await unlockWallet(driver);
57-
if (!process.env.MULTICHAIN) {
58-
return;
59-
}
6054
await waitForAccountRendered(driver);
6155
await connectToDapp(driver);
6256

test/e2e/tests/settings/change-language.spec.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const selectors = {
2828
headerText: { text: 'الإعدادات', tag: 'h3' },
2929
};
3030

31-
async function changeLanguage(driver: Driver , languageIndex: number) {
31+
async function changeLanguage(driver: Driver, languageIndex: number) {
3232
await driver.clickElement(selectors.accountOptionsMenuButton);
3333
await driver.clickElement(selectors.settingsOption);
3434

@@ -91,7 +91,7 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
9191

9292
async ({ driver }: { driver: Driver }) => {
9393
await unlockWallet(driver);
94-
await changeLanguage(driver, languageIndex );
94+
await changeLanguage(driver, languageIndex);
9595

9696
await driver.assertElementNotPresent('.loading-overlay__spinner');
9797

@@ -134,7 +134,6 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
134134
if (process.env.MULTICHAIN) {
135135
return;
136136
}
137-
138137
const languageIndex = 7;
139138
await withFixtures(
140139
{
@@ -145,7 +144,7 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
145144

146145
async ({ driver }: { driver: Driver }) => {
147146
await unlockWallet(driver);
148-
await changeLanguage( driver, languageIndex );
147+
await changeLanguage(driver, languageIndex);
149148
await driver.navigate();
150149
await driver.clickElement(selectors.ethOverviewSend);
151150
await driver.fill(selectors.ensInput, 'test');
@@ -167,7 +166,6 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
167166
if (process.env.MULTICHAIN) {
168167
return;
169168
}
170-
171169
const languageIndex = 19;
172170
await withFixtures(
173171
{
@@ -178,7 +176,7 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
178176

179177
async ({ driver }: { driver: Driver }) => {
180178
await unlockWallet(driver);
181-
await changeLanguage( driver, languageIndex );
179+
await changeLanguage(driver, languageIndex);
182180
await driver.navigate();
183181

184182
// Validate the account tooltip
@@ -216,7 +214,7 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
216214
async ({ driver }: { driver: Driver }) => {
217215
await unlockWallet(driver);
218216
// selects "Magyar" language
219-
await changeLanguage( driver, languageIndex );
217+
await changeLanguage(driver, languageIndex);
220218
await driver.navigate();
221219
await driver.clickElement(selectors.nftsTab);
222220

@@ -243,7 +241,7 @@ describe('Settings - general tab @no-mmi', function (this: Suite) {
243241
},
244242
async ({ driver }: { driver: Driver }) => {
245243
await unlockWallet(driver);
246-
await changeLanguage( driver, languageIndex );
244+
await changeLanguage(driver, languageIndex);
247245

248246
// Validate the header text
249247
const isHeaderTextChanged = await driver.isElementPresent(

ui/components/app/alerts/alerts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Alerts = ({ history }) => {
1818
if (_invalidCustomNetworkAlertIsOpen) {
1919
return <InvalidCustomNetworkAlert history={history} />;
2020
}
21-
if (_unconnectedAccountAlertIsOpen && !process.env.MULTICHAIN) {
21+
if (_unconnectedAccountAlertIsOpen) {
2222
return <UnconnectedAccountAlert />;
2323
}
2424

0 commit comments

Comments
 (0)