Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bharamboure-ledger committed Sep 11, 2024
1 parent e846d61 commit 850d715
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/tests/page/account.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { expect } from "@playwright/test";
import { step } from "tests/misc/reporters/step";
import { AppPage } from "tests/page/abstractClasses";
import { Account } from "tests/enum/Account";

export class AccountPage extends AppPage {
readonly settingsButton = this.page.getByTestId("account-settings-button");
private settingsDeleteButton = this.page.getByTestId("account-settings-delete-button");
Expand Down
18 changes: 12 additions & 6 deletions apps/ledger-live-desktop/tests/page/modal/receive.modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export class ReceiveModal extends Modal {
private warningMessage = this.page.locator('div[type="warning"]');
readonly selectAccountInput = this.page.locator('[placeholder="Search"]');

private sendAssetWarningMessage = (
account: Account,
specificTokens: string,
) => `Please only send ${account.currency.ticker} or ${specificTokens} tokens to ${account.currency.name} accounts.
Sending other crypto assets may result in the permanent loss of funds.`;
private sendTronAddressActivationWarningMessage =
"You first need to send at least 0.1 TRX to this address to activate it. Learn more";

@step("Select token")
async selectToken(SubAccount: Account) {
await this.selectAccount.click();
Expand All @@ -41,16 +49,14 @@ export class ReceiveModal extends Modal {
@step("Verify send currency / tokens warning message $1")
async verifySendCurrencyTokensWarningMessage(account: Account, specificTokens: string) {
await expect(this.warningMessage).toBeVisible();
await expect(this.warningMessage)
.toContainText(`Please only send ${account.currency.ticker} or ${specificTokens} tokens to ${account.currency.name} accounts.
Sending other crypto assets may result in the permanent loss of funds.`);
await expect(this.warningMessage).toContainText(
this.sendAssetWarningMessage(account, specificTokens),
);
}

@step("Verify TRON address activation warning message")
async verifyTronAddressActivationWarningMessage() {
await expect(this.warningMessage).toBeVisible();
await expect(this.warningMessage).toContainText(
`You first need to send at least 0.1 TRX to this address to activate it. Learn more`,
);
await expect(this.warningMessage).toContainText(this.sendTronAddressActivationWarningMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ for (const account of accounts) {
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.accountName);
await app.account.expectAccountVisibility(account.accountName);

await app.account.clickReceive();
switch (account) {
case Account.TRX_1:
Expand Down Expand Up @@ -82,7 +81,6 @@ test.describe("Receive", () => {
await app.layout.goToAccounts();
await app.accounts.navigateToAccountByName(account.accountName);
await app.account.expectAccountVisibility(account.accountName);

await app.account.clickReceive();
await app.modal.continue();
await app.receive.verifyTronAddressActivationWarningMessage();
Expand Down

0 comments on commit 850d715

Please sign in to comment.