-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
test(3664): add unit tests for network permissions components #13401
base: main
Are you sure you want to change the base?
test(3664): add unit tests for network permissions components #13401
Conversation
- Added a test case to verify that the PermissionsManager component correctly renders the empty state when no permissions exist. - Validates the presence of the session manager container and the appropriate empty state texts.
…k selection and permission updates - Ensure proper rendering of the NetworkConnectMultiSelector component. - Verify initialization with permitted chains from caveat data. - Test user interactions for network selection and toggling the update button state. - Confirm proper handling of network disconnects when no networks are selected. - Validate error handling when retrieving permitted chains. This commit enhances our test coverage and reinforces the component's robustness.
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. |
|
Add test coverage for PermittedNetworksInfoSheet component including: - Create constants file for test IDs - Add snapshot test - Test title, description and button rendering - Test container styles - Test button interaction - Add test IDs to component elements
Tests cover rendering, date formatting, default states and user interactions
|
- Add explicit types for mock functions and navigation props - Remove unused imports across test files - Improve mock component type definitions
- Move forwardRef and useImperativeHandle inside mock factory - Add proper TypeScript types for BottomSheet ref - Follow Jest naming conventions for mock variables
- Add test suite for NetworkSelectorList component - Mock react-native Linking API - Test rendering, network selection, and right accessory functionality - Add snapshot test
|
|
…tID for account list - Introduce a new test file for AccountConnectMultiSelector with snapshot tests, accounts list display, add account button press, and primary action button press. - Update AccountConnectMultiSelector.tsx to add a testID prop to the AccountSelectorList, so it can be properly targeted by tests. - Skip tests for select/unselect checkbox, disconnect action, and back button press for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
|
|
Description
This PR adds comprehensive unit tests for components involved in managing network permissions.
Key Changes
Related issues
Contributes to: https://github.com/MetaMask/MetaMask-planning/issues/3664
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist