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

test: wip, can't select Account 1 label or it's ID #12812

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
}, [networkAvatars, isAlreadyConnected]);

function renderAccountPermissionsRequestInfoCard() {
console.log('>>> getAccountLabel()', getAccountLabel() === 'Account 1');

Check failure on line 274 in app/components/UI/PermissionsSummary/PermissionsSummary.tsx

View workflow job for this annotation

GitHub Actions / scripts (lint)

Unexpected console statement
return (
<TouchableOpacity onPress={handleEditAccountsButtonPress}>
<View
Expand All @@ -292,7 +293,12 @@
<View style={styles.permissionRequestAccountInfo}>
<View style={styles.permissionRequestAccountName}>
<TextComponent numberOfLines={1} ellipsizeMode="tail">
<TextComponent variant={TextVariant.BodySM}>
<TextComponent
testID={
PermissionSummaryBottomSheetSelectorsIDs.ACCOUNT_PERMISSION_TEXT
}
variant={TextVariant.BodySM}
>
{getAccountLabel()}
</TextComponent>
</TextComponent>
Expand Down
13 changes: 7 additions & 6 deletions e2e/pages/Browser/PermissionSummaryBottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ class PermissionSummaryBottomSheet {
PermissionSummaryBottomSheetSelectorsIDs.CONTAINER,
);
}
get addNetworkPermissionContainer() {
return Matchers.getElementByID(
PermissionSummaryBottomSheetSelectorsIDs.NETWORK_PERMISSIONS_CONTAINER,

get ethereumMainnetText() {
return Matchers.getElementByText(
PermissionSummaryBottomSheetSelectorsText.ETHEREUM_MAINNET_TEXT,
);
}

get connectedAccountsText() {
return Matchers.getElementByText(
PermissionSummaryBottomSheetSelectorsText.CONNECTED_ACCOUNTS_TEXT,
get accountPermissionText() {
return Matchers.getElementByID(
PermissionSummaryBottomSheetSelectorsIDs.ACCOUNT_PERMISSION_TEXT,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import enContent from '../../../locales/languages/en.json';
export const PermissionSummaryBottomSheetSelectorsIDs = {
CONTAINER: 'permission-summary-container',
NETWORK_PERMISSIONS_CONTAINER: 'permission-network-permissions-container',
ACCOUNT_PERMISSION_TEXT: 'permission-summary-account-text',
};

export const PermissionSummaryBottomSheetSelectorsText = {
CONNECTED_ACCOUNTS_TEXT: enContent.accounts.connected_accounts_title,
ADD_NETWORK_PERMISSION: enContent.permissions.title_add_network_permission,
ETHEREUM_MAINNET_TEXT: 'Ethereum Main Network',
ACCOUNT_ONE_TEXT: 'Account 1',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';
import TestHelpers from '../../helpers';
import { SmokeMultiChain } from '../../tags';
import Browser from '../../pages/Browser/BrowserView';
import TabBarComponent from '../../pages/wallet/TabBarComponent';
import ConnectedAccountsModal from '../../pages/Browser/ConnectedAccountsModal';
import FixtureBuilder from '../../fixtures/fixture-builder';
import { withFixtures } from '../../fixtures/fixture-helper';
import { loginToApp } from '../../viewHelper';
import Assertions from '../../utils/Assertions';
import PermissionSummaryBottomSheet from '../../pages/Browser/PermissionSummaryBottomSheet';

describe(SmokeMultiChain('MultiChain Permissions System:'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
});

fit('should display default chain and account in permission summary', async () => {
await withFixtures(
{
dapp: true,
fixture: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.withChainPermission() // Initialize with only Ethereum mainnet
.build(),
restartDevice: true,
},
async () => {
await loginToApp();
await TabBarComponent.tapBrowser();
await Browser.navigateToTestDApp();

// Open permissions modal
await Browser.tapNetworkAvatarButtonOnBrowser();
await ConnectedAccountsModal.tapManagePermissionsButton();

// Verify default permissions
await Assertions.checkIfVisible(
PermissionSummaryBottomSheet.ethereumMainnetText,
);
await Assertions.checkIfVisible(
PermissionSummaryBottomSheet.accountPermissionText,
);
},
);
});
});
Loading