Skip to content

Commit a23d465

Browse files
authored
Merge branch 'main' into typed_sign_primarytype_validation
2 parents 6d0cab3 + 8a6f4f9 commit a23d465

26 files changed

+564
-525
lines changed

test/e2e/constants.ts

+7
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,10 @@ export const DEFAULT_SOLANA_BALANCE = 1; // SOL
7676

7777
/* Title of the mocked E2E test empty HTML page */
7878
export const EMPTY_E2E_TEST_PAGE_TITLE = 'E2E Test Page';
79+
80+
/* Account types */
81+
export enum ACCOUNT_TYPE {
82+
Ethereum,
83+
Bitcoin,
84+
Solana,
85+
}

test/e2e/flask/btc/common-btc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Mockttp } from 'mockttp';
22
import FixtureBuilder from '../../fixture-builder';
33
import { withFixtures } from '../../helpers';
44
import {
5+
ACCOUNT_TYPE,
56
DEFAULT_BTC_ACCOUNT,
67
DEFAULT_BTC_BALANCE,
78
DEFAULT_BTC_FEES_RATE,
@@ -14,7 +15,6 @@ import { Driver } from '../../webdriver/driver';
1415
import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow';
1516
import AccountListPage from '../../page-objects/pages/account-list-page';
1617
import HeaderNavbar from '../../page-objects/pages/header-navbar';
17-
import { ACCOUNT_TYPE } from '../../page-objects/common';
1818

1919
const QUICKNODE_URL_REGEX = /^https:\/\/.*\.btc.*\.quiknode\.pro(\/|$)/u;
2020

@@ -218,7 +218,7 @@ export async function withBtcAccountSnap(
218218
await new HeaderNavbar(driver).openAccountMenu();
219219
const accountListPage = new AccountListPage(driver);
220220
await accountListPage.check_pageIsLoaded();
221-
await accountListPage.addAccount(ACCOUNT_TYPE.Bitcoin, '');
221+
await accountListPage.addAccount({ accountType: ACCOUNT_TYPE.Bitcoin });
222222
await test(driver, mockServer);
223223
},
224224
);

test/e2e/flask/btc/create-btc-account.spec.ts

+22-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { strict as assert } from 'assert';
22
import { Suite } from 'mocha';
33
import { WALLET_PASSWORD } from '../../helpers';
4+
import AccountDetailsModal from '../../page-objects/pages/dialog/account-details-modal';
45
import AccountListPage from '../../page-objects/pages/account-list-page';
56
import HeaderNavbar from '../../page-objects/pages/header-navbar';
67
import LoginPage from '../../page-objects/pages/login-page';
78
import PrivacySettings from '../../page-objects/pages/settings/privacy-settings';
89
import ResetPasswordPage from '../../page-objects/pages/reset-password-page';
910
import SettingsPage from '../../page-objects/pages/settings/settings-page';
10-
import { ACCOUNT_TYPE } from '../../page-objects/common';
11+
import { ACCOUNT_TYPE } from '../../constants';
1112
import { withBtcAccountSnap } from './common-btc';
1213

1314
describe('Create BTC Account', function (this: Suite) {
@@ -82,9 +83,11 @@ describe('Create BTC Account', function (this: Suite) {
8283
await headerNavbar.openAccountMenu();
8384
const accountListPage = new AccountListPage(driver);
8485
await accountListPage.check_pageIsLoaded();
85-
const accountAddress = await accountListPage.getAccountAddress(
86-
'Bitcoin Account',
87-
);
86+
await accountListPage.openAccountDetailsModal('Bitcoin Account');
87+
88+
const accountDetailsModal = new AccountDetailsModal(driver);
89+
await accountDetailsModal.check_pageIsLoaded();
90+
const accountAddress = await accountDetailsModal.getAccountAddress();
8891
await headerNavbar.openAccountMenu();
8992
await accountListPage.removeAccount('Bitcoin Account');
9093

@@ -97,14 +100,15 @@ describe('Create BTC Account', function (this: Suite) {
97100
);
98101
await accountListPage.closeAccountModal();
99102
await headerNavbar.openAccountMenu();
100-
await accountListPage.addAccount(ACCOUNT_TYPE.Bitcoin, '');
103+
await accountListPage.addAccount({ accountType: ACCOUNT_TYPE.Bitcoin });
101104
await headerNavbar.check_accountLabel('Bitcoin Account');
102105

103106
await headerNavbar.openAccountMenu();
104107
await accountListPage.check_pageIsLoaded();
105-
const recreatedAccountAddress = await accountListPage.getAccountAddress(
106-
'Bitcoin Account',
107-
);
108+
await accountListPage.openAccountDetailsModal('Bitcoin Account');
109+
await accountDetailsModal.check_pageIsLoaded();
110+
const recreatedAccountAddress =
111+
await accountDetailsModal.getAccountAddress();
108112

109113
assert(accountAddress === recreatedAccountAddress);
110114
},
@@ -123,9 +127,10 @@ describe('Create BTC Account', function (this: Suite) {
123127
await headerNavbar.openAccountMenu();
124128
const accountListPage = new AccountListPage(driver);
125129
await accountListPage.check_pageIsLoaded();
126-
const accountAddress = await accountListPage.getAccountAddress(
127-
'Bitcoin Account',
128-
);
130+
await accountListPage.openAccountDetailsModal('Bitcoin Account');
131+
const accountDetailsModal = new AccountDetailsModal(driver);
132+
await accountDetailsModal.check_pageIsLoaded();
133+
const accountAddress = await accountDetailsModal.getAccountAddress();
129134

130135
// go to privacy settings page and get the SRP
131136
await headerNavbar.openSettingsPage();
@@ -151,14 +156,16 @@ describe('Create BTC Account', function (this: Suite) {
151156
await headerNavbar.check_pageIsLoaded();
152157
await headerNavbar.openAccountMenu();
153158
await accountListPage.check_pageIsLoaded();
154-
await accountListPage.addAccount(ACCOUNT_TYPE.Bitcoin, '');
159+
await accountListPage.addAccount({ accountType: ACCOUNT_TYPE.Bitcoin });
155160
await headerNavbar.check_accountLabel('Bitcoin Account');
156161

157162
await headerNavbar.openAccountMenu();
158163
await accountListPage.check_pageIsLoaded();
159-
const recreatedAccountAddress = await accountListPage.getAccountAddress(
160-
'Bitcoin Account',
161-
);
164+
await accountListPage.openAccountDetailsModal('Bitcoin Account');
165+
await accountDetailsModal.check_pageIsLoaded();
166+
const recreatedAccountAddress =
167+
await accountDetailsModal.getAccountAddress();
168+
162169
assert(accountAddress === recreatedAccountAddress);
163170
},
164171
);

0 commit comments

Comments
 (0)