Skip to content

Commit ec9230f

Browse files
authored
test: remove bip44 ff from chain permissions tests (MetaMask#26961)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** The E2E tests for the files, e2e/specs/multichain/permissions/chains/permission-system-dapp-chain-switch-grant.spec.js tests/smoke/multichain/permissions/chains/permission-system-initial-connection.spec.js Fail once the BIP-44 flag is removed and currently it is being mocked to be OFF for this test. This mock is not correct since it does not represent the real state of the wallet in production. The goal of this ticket is to update the test file to be compatible with BIP-44. If the tests are not relevant anymore, they can be deleted from the test suite. For this remove the testSpecificMock from the fixture and check for failures in the test. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk because changes are isolated to Detox smoke tests and primarily adjust setup/expectations to match updated UI flows. Main risk is increased test flakiness if the new selectors/labels vary across builds or locales. > > **Overview** > Removes the remote feature-flag mocking from the chain-permissions smoke tests and unskips the dApp chain-switch permission test so it runs by default. > > Updates test flows/assertions to match the current Connected Accounts modal: checks for `disconnectAllAccountsAndNetworksButton` visibility instead of the modal title/manage-permissions step, uses select/deselect-all interactions for network permissions validation, and updates the expected network picker label (`'E'` -> `'l E'`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5c25e60. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5f6025d commit ec9230f

2 files changed

Lines changed: 11 additions & 30 deletions

File tree

tests/smoke/multichain/permissions/chains/permission-system-dapp-chain-switch-grant.spec.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ import ConnectedAccountsModal from '../../../../page-objects/Browser/ConnectedAc
1212
import NetworkConnectMultiSelector from '../../../../page-objects/Browser/NetworkConnectMultiSelector';
1313
import NetworkNonPemittedBottomSheet from '../../../../page-objects/Network/NetworkNonPemittedBottomSheet';
1414
import { DappVariants } from '../../../../framework/Constants';
15-
import { setupRemoteFeatureFlagsMock } from '../../../../api-mocking/helpers/remoteFeatureFlagsHelper';
16-
import { remoteFeatureMultichainAccountsAccountDetailsV2 } from '../../../../api-mocking/mock-responses/feature-flags-mocks';
1715

18-
describe.skip(SmokeNetworkAbstractions('Chain Permission System'), () => {
16+
describe(SmokeNetworkAbstractions('Chain Permission System'), () => {
1917
beforeAll(async () => {
2018
jest.setTimeout(150000);
2119
});
@@ -35,12 +33,6 @@ describe.skip(SmokeNetworkAbstractions('Chain Permission System'), () => {
3533
.withPermissionController()
3634
.build(),
3735
restartDevice: true,
38-
testSpecificMock: async (mockServer) => {
39-
await setupRemoteFeatureFlagsMock(
40-
mockServer,
41-
remoteFeatureMultichainAccountsAccountDetailsV2(false),
42-
);
43-
},
4436
},
4537
async () => {
4638
// Setup: Login and navigate to browser
@@ -69,11 +61,10 @@ describe.skip(SmokeNetworkAbstractions('Chain Permission System'), () => {
6961
await Browser.tapNetworkAvatarOrAccountButtonOnBrowser();
7062

7163
// Navigate back to second Dapp and verify chain permissions
72-
await ConnectedAccountsModal.tapManagePermissionsButton();
7364
await ConnectedAccountsModal.tapPermissionsSummaryTab();
7465

7566
const networkPicker = ConnectedAccountsModal.networkPicker;
76-
await Assertions.expectElementToHaveLabel(networkPicker, 'E');
67+
await Assertions.expectElementToHaveLabel(networkPicker, 'l E');
7768
},
7869
);
7970
});

tests/smoke/multichain/permissions/chains/permission-system-initial-connection.spec.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import ConnectBottomSheet from '../../../../page-objects/Browser/ConnectBottomSh
1111
import NetworkNonPemittedBottomSheet from '../../../../page-objects/Network/NetworkNonPemittedBottomSheet';
1212
import NetworkConnectMultiSelector from '../../../../page-objects/Browser/NetworkConnectMultiSelector';
1313
import { DappVariants } from '../../../../framework/Constants';
14-
import { setupRemoteFeatureFlagsMock } from '../../../../api-mocking/helpers/remoteFeatureFlagsHelper';
15-
import { remoteFeatureMultichainAccountsAccountDetailsV2 } from '../../../../api-mocking/mock-responses/feature-flags-mocks';
1614

1715
describe(SmokeNetworkExpansion('Chain Permission Management'), () => {
1816
beforeAll(async () => {
@@ -29,12 +27,6 @@ describe(SmokeNetworkExpansion('Chain Permission Management'), () => {
2927
],
3028
fixture: new FixtureBuilder().withPermissionController().build(),
3129
restartDevice: true,
32-
testSpecificMock: async (mockServer) => {
33-
await setupRemoteFeatureFlagsMock(
34-
mockServer,
35-
remoteFeatureMultichainAccountsAccountDetailsV2(false),
36-
);
37-
},
3830
},
3931
async () => {
4032
await loginToApp();
@@ -46,7 +38,9 @@ describe(SmokeNetworkExpansion('Chain Permission Management'), () => {
4638
await ConnectBottomSheet.tapConnectButton();
4739

4840
await Browser.tapNetworkAvatarOrAccountButtonOnBrowser();
49-
await Assertions.expectElementToBeVisible(ConnectedAccountsModal.title);
41+
await Assertions.expectElementToBeVisible(
42+
ConnectedAccountsModal.disconnectAllAccountsAndNetworksButton,
43+
);
5044
},
5145
);
5246
});
@@ -61,12 +55,6 @@ describe(SmokeNetworkExpansion('Chain Permission Management'), () => {
6155
],
6256
fixture: new FixtureBuilder().withPermissionController().build(),
6357
restartDevice: true,
64-
testSpecificMock: async (mockServer) => {
65-
await setupRemoteFeatureFlagsMock(
66-
mockServer,
67-
remoteFeatureMultichainAccountsAccountDetailsV2(false),
68-
);
69-
},
7058
},
7159
async () => {
7260
// Initial setup: Login and navigate to test dapp
@@ -97,16 +85,18 @@ describe(SmokeNetworkExpansion('Chain Permission Management'), () => {
9785

9886
// Open network permissions menu
9987
await Browser.tapNetworkAvatarOrAccountButtonOnBrowser();
100-
await Assertions.expectElementToBeVisible(ConnectedAccountsModal.title);
101-
await ConnectedAccountsModal.tapManagePermissionsButton();
88+
await Assertions.expectElementToBeVisible(
89+
ConnectedAccountsModal.disconnectAllAccountsAndNetworksButton,
90+
);
10291
await ConnectedAccountsModal.tapPermissionsSummaryTab();
10392
await ConnectedAccountsModal.tapNavigateToEditNetworksPermissionsButton();
10493

10594
// Verify final permissions state
10695
// - Should have only Ethereum Mainnet and Sepolia selected
10796
// - Deselecting both should show the disconnect all button
108-
await NetworkNonPemittedBottomSheet.tapEthereumMainNetNetworkName();
109-
await NetworkNonPemittedBottomSheet.tapSepoliaNetworkName();
97+
await ConnectedAccountsModal.tapSelectAllNetworksButton();
98+
await ConnectedAccountsModal.tapDeselectAllNetworksButton();
99+
110100
await Assertions.expectElementToBeVisible(
111101
ConnectedAccountsModal.disconnectNetworksButton,
112102
);

0 commit comments

Comments
 (0)