Skip to content
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

fix: Improve SelectedNetworkController tests with more robust behavio… #5534

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

@VolodymyrBg VolodymyrBg commented Mar 24, 2025

…ral testing

Explanation

This commit enhances the test coverage for SelectedNetworkController by implementing more comprehensive behavioral tests that better simulate real-world interactions:

  1. Added tests for snap domains that verify they consistently use the globally selected network when network changes occur
  2. Improved metamask domain tests to ensure it always follows the globally selected network through network changes
  3. Added robust behavioral testing for preference changes that show how domain requests are properly routed based on useRequestQueue settings
  4. Implemented multi-domain tests to verify correct behavior when toggling between different network preferences

These changes replace the simplistic mocking approaches with more realistic testing scenarios that better verify the controller's behavior in production environments.

References

TODO

Changelog

@metamask/package-a

  • : Your change here
  • : Your change here

@metamask/package-b

  • : Your change here
  • : Your change here

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@VolodymyrBg VolodymyrBg requested a review from a team as a code owner March 24, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant