Skip to content

Commit

Permalink
fixup! chore(suite): update network symbol naming 12
Browse files Browse the repository at this point in the history
  • Loading branch information
adderpositive committed Dec 11, 2024
1 parent a0edfc0 commit 14ec85c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export class SettingsActions {
readonly settingsCloseButton: Locator;
readonly modal: Locator;
//coin Advance settings
readonly coinNetworkButton = (symbol: NetworkSymbol) =>
readonly networkButton = (symbol: NetworkSymbol) =>
this.window.getByTestId(`@settings/wallet/network/${symbol}`);
readonly coinAdvanceSettingsButton = (symbol: NetworkSymbol) =>
readonly networkSymbolAdvanceSettingsButton = (symbol: NetworkSymbol) =>
this.window.getByTestId(`@settings/wallet/network/${symbol}/advance`);
readonly coinBackendSelector: Locator;
readonly coinBackendSelectorOption = (backend: BackendType) =>
Expand Down Expand Up @@ -69,24 +69,24 @@ export class SettingsActions {
await expect(this.debugTabButton).toBeVisible();
}

async openCoinAdvanceSettings(symbol: NetworkSymbol) {
const isCoinActive = await this.coinNetworkButton(symbol).getAttribute('data-active');
if (isCoinActive === 'false') {
await this.enableCoin(symbol);
async openNetworkAdvanceSettings(symbol: NetworkSymbol) {
const isNetworkActive = await this.networkButton(symbol).getAttribute('data-active');
if (isNetworkActive === 'false') {
await this.enableNetwork(symbol);
}
await this.coinNetworkButton(symbol).hover();
await this.coinAdvanceSettingsButton(symbol).click();
await this.networkButton(symbol).hover();
await this.networkSymbolAdvanceSettingsButton(symbol).click();
await expect(this.modal).toBeVisible();
}

async enableCoin(symbol: NetworkSymbol) {
await this.coinNetworkButton(symbol).click();
await expect(this.coinNetworkButton(symbol)).toBeEnabledCoin();
async enableNetwork(symbol: NetworkSymbol) {
await this.networkButton(symbol).click();
await expect(this.networkButton(symbol)).toBeEnabledCoin();
}

async disableCoin(symbol: NetworkSymbol) {
await this.coinNetworkButton(symbol).click();
await expect(this.coinNetworkButton(symbol)).toBeDisabledCoin();
async disableNetwork(symbol: NetworkSymbol) {
await this.networkButton(symbol).click();
await expect(this.networkButton(symbol)).toBeDisabledCoin();
}

async changeCoinBackend(backend: BackendType, backendUrl: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ test(
async ({ dashboardPage, settingsPage, walletPage }) => {
await settingsPage.navigateTo();
await settingsPage.coinsTabButton.click();
await settingsPage.enableCoin('ada');
await settingsPage.disableCoin('btc');
await settingsPage.enableNetwork('ada');
await settingsPage.disableNetwork('btc');

await dashboardPage.navigateTo();
await dashboardPage.discoveryShouldFinish();
Expand Down
8 changes: 4 additions & 4 deletions packages/suite-desktop-core/e2e/tests/settings/coins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ test.describe('Coin Settings', { tag: ['@group=settings'] }, () => {
'dsol',
];

await expect(settingsPage.coinNetworkButton('btc')).toBeEnabledCoin();
await expect(settingsPage.networkButton('btc')).toBeEnabledCoin();
for (const network of defaultUnchecked) {
await expect(settingsPage.coinNetworkButton(network)).toBeDisabledCoin();
await expect(settingsPage.networkButton(network)).toBeDisabledCoin();
}

await settingsPage.disableCoin('btc');
await settingsPage.disableNetwork('btc');

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

//TODO: #15811 this is just not useful validation. To be refactored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test.describe.serial(

await settingsPage.navigateTo();
await settingsPage.coinsTabButton.click();
await settingsPage.openCoinAdvanceSettings('regtest');
await settingsPage.openNetworkAdvanceSettings('regtest');
await settingsPage.changeCoinBackend('electrum', electrumUrl);

await dashboardPage.navigateTo();
Expand Down

0 comments on commit 14ec85c

Please sign in to comment.