diff --git a/app/components/UI/PermissionsSummary/PermissionsSummary.tsx b/app/components/UI/PermissionsSummary/PermissionsSummary.tsx index cf998ed53a2..aa177bf84e7 100644 --- a/app/components/UI/PermissionsSummary/PermissionsSummary.tsx +++ b/app/components/UI/PermissionsSummary/PermissionsSummary.tsx @@ -291,7 +291,13 @@ const PermissionsSummary = ({ - + {getAccountLabel()} diff --git a/app/components/UI/PermissionsSummary/__snapshots__/PermissionsSummary.test.tsx.snap b/app/components/UI/PermissionsSummary/__snapshots__/PermissionsSummary.test.tsx.snap index 5a7dd44c123..58a4fd16bfb 100644 --- a/app/components/UI/PermissionsSummary/__snapshots__/PermissionsSummary.test.tsx.snap +++ b/app/components/UI/PermissionsSummary/__snapshots__/PermissionsSummary.test.tsx.snap @@ -232,6 +232,7 @@ exports[`PermissionsSummary should render correctly 1`] = ` "lineHeight": 22, } } + testID="permission-summary-account-text" > { + beforeAll(async () => { + jest.setTimeout(150000); + await TestHelpers.reverseServerPort(); + }); + + it('should display default account and chain permissions in permission summary', async () => { + // Test setup with fixtures + await withFixtures( + { + dapp: true, + fixture: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .withChainPermission() // Initialize with Ethereum mainnet only + .build(), + restartDevice: true, + }, + async () => { + // Step 1: Initial app setup + await loginToApp(); + await TabBarComponent.tapBrowser(); + await Browser.navigateToTestDApp(); + + // Step 2: Navigate to permissions management + await Browser.tapNetworkAvatarButtonOnBrowser(); + await ConnectedAccountsModal.tapManagePermissionsButton(); + + // Step 3: Verify account permissions + const accountLabelElement = + await PermissionSummaryBottomSheet.accountPermissionLabelContainer; + const accountLabelAttributes = + await accountLabelElement.getAttributes(); + const accountLabel = accountLabelAttributes.label; + + await Assertions.checkIfTextMatches( + accountLabel, + PermissionSummaryBottomSheetSelectorsText.ACCOUNT_ONE_LABEL, + ); + + // Step 4: Verify chain permissions + await Assertions.checkIfVisible( + PermissionSummaryBottomSheet.ethereumMainnetText, + ); + }, + ); + }); + }, +);