Skip to content

chore(4144): enable feature flag and fix unit tests falling this enable. #16150

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

Merged

Conversation

EtherWizard33
Copy link
Contributor

@EtherWizard33 EtherWizard33 commented Jun 5, 2025

Description

This enables the per dapp selected network feature flag. And updates the related unit tests.

These files have failing tests need to be fix

on main:
modified: app/components/UI/PermissionsSummary/PermissionsSummary.test.tsx (snaps updated by Eric)
modified: app/components/UI/TransactionElement/TransactionDetails/index.test.tsx (snaps updated by Eric)
modified: app/components/Views/AccountPermissions/AccountPermissions.test.tsx (fixed by Eric)
modified: app/components/Views/confirmations/components/confirm/confirm-component.test.tsx (fixed by Goktug)
modified: app/components/Views/confirmations/components/info-root/info-root.test.tsx (fixed by Goktug)
modified: app/components/Views/confirmations/components/info/switch-account-type/switch-account-type.test.tsx (fixed by Goktug)
modified: app/components/Views/confirmations/legacy/SendFlow/Confirm/index.test.tsx (fixed by Goktug)

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@EtherWizard33 EtherWizard33 added No QA Needed Apply this label when your PR does not need any QA effort. No E2E Smoke Needed If the PR does not need E2E smoke test run team-wallet-ux labels Jun 5, 2025
Copy link
Contributor

github-actions bot commented Jun 5, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@EtherWizard33 EtherWizard33 changed the title chore: temp DO NOT MERGE, hardcoded per-dapp feature flags chore(4144): enable feature flag and fix unit tests falling this enable. Jun 5, 2025
@mobularay mobularay added the Per-Dapp-Selected-Network Used for PRs and issues related to Per Dapp Selected Network label Jun 5, 2025
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing and removed No E2E Smoke Needed If the PR does not need E2E smoke test run labels Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 68ce300
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c1f40b17-d5ab-4e77-9ad9-6782dff2b79d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@EtherWizard33 EtherWizard33 added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jun 6, 2025
@mobularay
Copy link
Contributor

From today's daily sync: it's agreed that we will skip the SonarCloud requirement as part of our readiness to be cherry-picked into v7.49.0 RC cut. @EtherWizard33 @OGPoyraz @adonesky1 @NidhiKJha @hesterbruikman @sleepytanya

Heads-up @sethkfman @Cal-L @cortisiko @Unik0rnMaggie @jvbriones. Pls let us know if you disagree with this decision.

@vinnyhoward vinnyhoward added release-7.49.0 Issue or pull request that will be included in release 7.49.0 and removed release-7.49.0 Issue or pull request that will be included in release 7.49.0 labels Jun 6, 2025
…cted-network is enabled these tests are not needed
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 7, 2025
Copy link
Contributor

github-actions bot commented Jun 7, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 6fa0a6d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/028ac2f0-b898-4c36-ad32-7cad69f99c00

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 8, 2025
Copy link
Contributor

github-actions bot commented Jun 8, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 3a5de12
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/78536411-ee37-41f7-b105-17482f59480d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added the Run Smoke E2E Requires smoke E2E testing label Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: c5722e4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a68b31e1-5322-497b-9684-c06189e2c064

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 9, 2025
@NidhiKJha NidhiKJha force-pushed the test-per-dapp-fixing-test-failing-when-per-dapp-is-enabled branch from 8a6da4c to 5efb0b0 Compare June 9, 2025 13:31
@EtherWizard33 EtherWizard33 added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 5efb0b0
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/862e25a6-605d-4f27-9082-9748b43c2299

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@hesterbruikman hesterbruikman added the release-7.49.0 Issue or pull request that will be included in release 7.49.0 label Jun 9, 2025
Copy link

sonarqubecloud bot commented Jun 9, 2025

@vinnyhoward vinnyhoward requested a review from Copilot June 9, 2025 17:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the per dapp selected network feature flag and updates several unit tests to fix failing snapshots and behavior.

  • Updated test flows to align with the new network flag behavior.
  • Removed or updated redundant assertions (e.g., assertions for “Sent ETH”) from confirmation tests.
  • Updated network-related helper functions and controller mocks to enforce the new flag behavior.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
e2e/specs/multichain/permissions/chains/permission-system-dapp-chain-switch-grant.spec.js Updated test navigation flow and assertion for network selection.
e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js Disabled a test suite (using xdescribe) for non-permitted chains.
e2e/specs/confirmations-redesigned/transactions/wallet-initiated-transfer.spec.ts Removed outdated assertion checking for text "Sent ETH".
e2e/specs/confirmations-redesigned/transactions/send-max-transfer.spec.ts Similar update to the wallet initiated transfer tests.
e2e/specs/confirmations-redesigned/transactions/per-dapp-selected-network.spec.js Added a new test verifying the per dapp selected network behavior.
e2e/specs/confirmations-redesigned/transactions/dapp-initiated-transfer.spec.ts Removed outdated assertion checking for text "Sent ETH".
e2e/selectors/Browser/TestDapp.selectors.js Added a new selector for chain ID text.
app/util/networks/index.js Enabled the per dapp selected network flag by returning true.
app/components/hooks/useAddressBalance/useAddressBalance.ts Adjusted account selection to default to an empty object if undefined.
app/components/Views/confirmations/legacy/SendFlow/Confirm/snapshots/index.test.tsx.snap Updated snapshot text to reflect network name changes.
app/components/Views/AccountPermissions/AccountPermissions.test.tsx Updated expectations to reflect the new SelectedNetworkController API.
Comments suppressed due to low confidence (1)

e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js:19

  • The test has been disabled using xdescribe without an accompanying comment. Consider adding an explanation for its temporary disablement to aid future maintainability.
xdescribe(

@NidhiKJha NidhiKJha enabled auto-merge June 9, 2025 17:59
@NidhiKJha NidhiKJha added No E2E Smoke Needed If the PR does not need E2E smoke test run and removed Run Smoke E2E Requires smoke E2E testing labels Jun 9, 2025
@NidhiKJha NidhiKJha added this pull request to the merge queue Jun 9, 2025
@NidhiKJha
Copy link
Member

Skipped smoke test as it was coming from main

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 9, 2025
@NidhiKJha NidhiKJha added this pull request to the merge queue Jun 9, 2025
Merged via the queue into main with commit a61623c Jun 9, 2025
47 of 48 checks passed
@NidhiKJha NidhiKJha deleted the test-per-dapp-fixing-test-failing-when-per-dapp-is-enabled branch June 9, 2025 18:48
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2025
@metamaskbot metamaskbot added the release-7.50.0 Issue or pull request that will be included in release 7.50.0 label Jun 9, 2025
@@ -633,8 +633,7 @@ export const isChainPermissionsFeatureEnabled = true;
export const isPermissionsSettingsV1Enabled =
process.env.MM_PERMISSIONS_SETTINGS_V1_ENABLED === 'true';

export const isPerDappSelectedNetworkEnabled = () =>
process.env.MM_PER_DAPP_SELECTED_NETWORK === 'true';
export const isPerDappSelectedNetworkEnabled = () => true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should get rid of this altogether? And get rid of the env variable in bitrise.yml?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. Per-Dapp-Selected-Network Used for PRs and issues related to Per Dapp Selected Network release-7.49.0 Issue or pull request that will be included in release 7.49.0 release-7.50.0 Issue or pull request that will be included in release 7.50.0 team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: unit tests requiring to be fixed in order turn the feature flag (per-app) to ON