Skip to content

Commit b76eeed

Browse files
adderpositivetomasklim
authored andcommitted
chore(suite): update network symbol naming 12
1 parent ecbf01e commit b76eeed

File tree

16 files changed

+72
-70
lines changed

16 files changed

+72
-70
lines changed

packages/suite-desktop-core/e2e/support/pageActions/dashboardActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export class DashboardActions {
1616
this.window.getByTestId(`@switch-device/wallet-on-index/${index}/eject-button`);
1717
readonly confirmDeviceEjectButton: Locator;
1818
readonly addStandardWalletButton: Locator;
19-
readonly balanceOfNetwork = (network: NetworkSymbol) =>
20-
this.window.getByTestId(`@wallet/coin-balance/value-${network}`);
19+
readonly balanceOfNetwork = (symbol: NetworkSymbol) =>
20+
this.window.getByTestId(`@wallet/coin-balance/value-${symbol}`);
2121

2222
constructor(window: Page) {
2323
this.window = window;

packages/suite-desktop-core/e2e/support/pageActions/settingsActions.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export class SettingsActions {
5252
readonly confirmOnDevicePrompt: Locator;
5353
readonly homescreenGalleryButton: Locator;
5454
//coin Advance settings
55-
readonly coinNetworkButton = (coin: NetworkSymbol) =>
56-
this.window.getByTestId(`@settings/wallet/network/${coin}`);
57-
readonly coinAdvanceSettingsButton = (coin: NetworkSymbol) =>
58-
this.window.getByTestId(`@settings/wallet/network/${coin}/advance`);
55+
readonly networkButton = (symbol: NetworkSymbol) =>
56+
this.window.getByTestId(`@settings/wallet/network/${symbol}`);
57+
readonly networkSymbolAdvanceSettingsButton = (symbol: NetworkSymbol) =>
58+
this.window.getByTestId(`@settings/wallet/network/${symbol}/advance`);
5959
readonly coinBackendSelector: Locator;
6060
readonly coinBackendSelectorOption = (backend: BackendType) =>
6161
this.window.getByTestId(`@settings/advance/${backend}`);
@@ -116,24 +116,24 @@ export class SettingsActions {
116116
await expect(this.debugTabButton).toBeVisible();
117117
}
118118

119-
async openCoinAdvanceSettings(coin: NetworkSymbol) {
120-
const isCoinActive = await this.coinNetworkButton(coin).getAttribute('data-active');
121-
if (isCoinActive === 'false') {
122-
await this.enableCoin(coin);
119+
async openNetworkAdvanceSettings(symbol: NetworkSymbol) {
120+
const isNetworkActive = await this.networkButton(symbol).getAttribute('data-active');
121+
if (isNetworkActive === 'false') {
122+
await this.enableNetwork(symbol);
123123
}
124-
await this.coinNetworkButton(coin).hover();
125-
await this.coinAdvanceSettingsButton(coin).click();
124+
await this.networkButton(symbol).hover();
125+
await this.networkSymbolAdvanceSettingsButton(symbol).click();
126126
await expect(this.modal).toBeVisible();
127127
}
128128

129-
async enableCoin(coin: NetworkSymbol) {
130-
await this.coinNetworkButton(coin).click();
131-
await expect(this.coinNetworkButton(coin)).toBeEnabledCoin();
129+
async enableNetwork(symbol: NetworkSymbol) {
130+
await this.networkButton(symbol).click();
131+
await expect(this.networkButton(symbol)).toBeEnabledCoin();
132132
}
133133

134-
async disableCoin(coin: NetworkSymbol) {
135-
await this.coinNetworkButton(coin).click();
136-
await expect(this.coinNetworkButton(coin)).toBeDisabledCoin();
134+
async disableNetwork(symbol: NetworkSymbol) {
135+
await this.networkButton(symbol).click();
136+
await expect(this.networkButton(symbol)).toBeDisabledCoin();
137137
}
138138

139139
async changeCoinBackend(backend: BackendType, backendUrl: string) {

packages/suite-desktop-core/e2e/support/pageActions/walletActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export class WalletActions {
4444
}
4545
}
4646

47-
async getAccountsCount(network: NetworkSymbol) {
47+
async getAccountsCount(symbol: NetworkSymbol) {
4848
return await this.window
49-
.locator(`[data-testid*="@account-menu/${network}"][tabindex]`)
49+
.locator(`[data-testid*="@account-menu/${symbol}"][tabindex]`)
5050
.count();
5151
}
5252
}

packages/suite-desktop-core/e2e/tests/general/cardano-discovery.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ test(
2626
async ({ dashboardPage, settingsPage, walletPage }) => {
2727
await settingsPage.navigateTo();
2828
await settingsPage.coinsTabButton.click();
29-
await settingsPage.enableCoin('ada');
30-
await settingsPage.disableCoin('btc');
29+
await settingsPage.enableNetwork('ada');
30+
await settingsPage.disableNetwork('btc');
3131

3232
await dashboardPage.navigateTo();
3333
await dashboardPage.discoveryShouldFinish();

packages/suite-desktop-core/e2e/tests/settings/coins.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ test.describe('Coin Settings', { tag: ['@group=settings'] }, () => {
4040
'dsol',
4141
];
4242

43-
await expect(settingsPage.coinNetworkButton('btc')).toBeEnabledCoin();
43+
await expect(settingsPage.networkButton('btc')).toBeEnabledCoin();
4444
for (const network of defaultUnchecked) {
45-
await expect(settingsPage.coinNetworkButton(network)).toBeDisabledCoin();
45+
await expect(settingsPage.networkButton(network)).toBeDisabledCoin();
4646
}
4747

48-
await settingsPage.disableCoin('btc');
48+
await settingsPage.disableNetwork('btc');
4949

5050
// check dashboard with all coins disabled
5151
await dashboardPage.navigateTo();
@@ -57,7 +57,7 @@ test.describe('Coin Settings', { tag: ['@group=settings'] }, () => {
5757
await settingsPage.coinsTabButton.click();
5858
// just do some clicking on switches and check result
5959
for (const network of ['btc', ...defaultUnchecked] as NetworkSymbol[]) {
60-
await settingsPage.enableCoin(network);
60+
await settingsPage.enableNetwork(network);
6161
}
6262

6363
//TODO: #15811 this is just not useful validation. To be refactored

packages/suite-desktop-core/e2e/tests/settings/electrum.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test.describe.serial(
2727

2828
await settingsPage.navigateTo();
2929
await settingsPage.coinsTabButton.click();
30-
await settingsPage.openCoinAdvanceSettings('regtest');
30+
await settingsPage.openNetworkAdvanceSettings('regtest');
3131
await settingsPage.changeCoinBackend('electrum', electrumUrl);
3232

3333
await dashboardPage.navigateTo();

packages/suite-web/e2e/support/pageObjects/accountsObject.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class AccountsPage {
1111
cy.getTestElement(`@account-menu/btc/normal/${index}`).click();
1212
}
1313

14-
applyCoinFilter(coin: NetworkSymbol) {
15-
cy.getTestElement(`@account-menu/filter/${coin}`).as('account').click();
14+
applyCoinFilter(symbol: NetworkSymbol) {
15+
cy.getTestElement(`@account-menu/filter/${symbol}`).as('account').click();
1616
cy.get('@account').invoke('attr', 'data-test-activated').should('eq', 'true');
1717
}
1818

@@ -21,10 +21,10 @@ class AccountsPage {
2121
cy.getTestElement('@modal').should('be.visible');
2222
}
2323

24-
activatNewCoin(coinName: NetworkSymbol) {
24+
activatNewCoin(symbol: NetworkSymbol) {
2525
this.openAddAccountsModal();
2626
cy.getTestElement('@modal/account/activate_more_coins').click();
27-
cy.getTestElement(`@settings/wallet/network/${coinName}`).click();
27+
cy.getTestElement(`@settings/wallet/network/${symbol}`).click();
2828
cy.contains('button', 'Find my').click();
2929
cy.getTestElement('@modal').should('not.exist');
3030
cy.discoveryShouldFinish();
@@ -84,8 +84,8 @@ class AccountsPage {
8484
cy.getTestElement('@app').scrollTo('bottom');
8585
}
8686

87-
clickOnDesiredAccount(coinName: NetworkSymbol) {
88-
cy.getTestElement(`@account-menu/${coinName}/normal/0`).click('left');
87+
clickOnDesiredAccount(symbol: NetworkSymbol) {
88+
cy.getTestElement(`@account-menu/${symbol}/normal/0`).click('left');
8989
}
9090

9191
exportDesiredTransactionType(typeOfExport: string) {

packages/suite-web/e2e/support/pageObjects/settings/settingsCryptoObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { NetworkSymbol } from '@suite-common/wallet-config';
44

55
class SettingsCrypto {
6-
activateCoin(coin: NetworkSymbol) {
7-
cy.getTestElement(`@settings/wallet/network/${coin}`).as('selectedCoin').click();
6+
activateCoin(symbol: NetworkSymbol) {
7+
cy.getTestElement(`@settings/wallet/network/${symbol}`).as('selectedCoin').click();
88
cy.get('@selectedCoin').invoke('attr', 'data-active').should('be.eq', 'true');
99
}
1010
}

packages/suite-web/e2e/support/pageObjects/topBarObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { NetworkSymbol } from '@suite-common/wallet-config';
44

55
class NavBar {
6-
openDefaultAcccount(coin: NetworkSymbol = 'btc') {
7-
cy.getTestElement(`@account-menu/${coin}/normal/0`).click();
6+
openDefaultAcccount(symbol: NetworkSymbol = 'btc') {
7+
cy.getTestElement(`@account-menu/${symbol}/normal/0`).click();
88
}
99

1010
openSettings() {

packages/suite-web/e2e/tests/wallet/add-account-types.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,37 +116,37 @@ describe('Account types suite', () => {
116116
//
117117
// Test execution
118118
//
119-
const coins: NetworkSymbol[] = ['ada', 'eth'];
119+
const symbols: NetworkSymbol[] = ['ada', 'eth'];
120120

121121
// activate the coin
122122
onNavBar.openSettings();
123123
cy.getTestElement('@settings/menu/wallet').click();
124-
coins.forEach((coin: NetworkSymbol) => {
125-
onSettingsCryptoPage.activateCoin(coin);
124+
symbols.forEach((symbol: NetworkSymbol) => {
125+
onSettingsCryptoPage.activateCoin(symbol);
126126
});
127127

128128
cy.getTestElement('@suite/menu/suite-index').click();
129129
onNavBar.openDefaultAcccount();
130130
cy.discoveryShouldFinish();
131131
// cardano
132-
coins.forEach((coin: NetworkSymbol) => {
133-
onAccountsPage.applyCoinFilter(coin);
132+
symbols.forEach((symbol: NetworkSymbol) => {
133+
onAccountsPage.applyCoinFilter(symbol);
134134
// get the element containing all accounts
135135
cy.get(
136-
`[data-testid="@account-menu/normal/group"] > [data-testid*="@account-menu/${coin}/normal"]`,
136+
`[data-testid="@account-menu/normal/group"] > [data-testid*="@account-menu/${symbol}/normal"]`,
137137
).then(currentAccounts => {
138138
const numberOfAccounts1 = currentAccounts.length;
139139

140140
cy.getTestElement('@account-menu/add-account').click();
141141
cy.getTestElement('@modal').should('be.visible');
142-
cy.get(`[data-testid="@settings/wallet/network/${coin}"]`)
142+
cy.get(`[data-testid="@settings/wallet/network/${symbol}"]`)
143143
.should('be.visible')
144144
.click();
145145
cy.getTestElement('@add-account').click();
146146
cy.discoveryShouldFinish();
147147

148148
cy.get(
149-
`[data-testid="@account-menu/normal/group"] > [data-testid*="@account-menu/${coin}/normal"]`,
149+
`[data-testid="@account-menu/normal/group"] > [data-testid*="@account-menu/${symbol}/normal"]`,
150150
).then(newAccounts => {
151151
const numberOfAccounts2 = newAccounts.length;
152152
expect(numberOfAccounts2).to.be.equal(numberOfAccounts1 + 1);

0 commit comments

Comments
 (0)