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 753f645
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 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 @@ -62,7 +62,7 @@ for (const account of accounts) {
});
}

test.describe("Receive", () => {
test.describe.only("Receive", () => {
const account = Account.TRX_2;
test.use({
userdata: "speculos-tests-app",
Expand Down

0 comments on commit 753f645

Please sign in to comment.