Skip to content

Commit

Permalink
Merge pull request #7830 from LedgerHQ/support/fix-e2e-tests
Browse files Browse the repository at this point in the history
🐛 fixing e2e tests
  • Loading branch information
ypolishchuk-ledger authored Sep 18, 2024
2 parents 8cd028a + 3005a7b commit 8d78fe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const LowGasAlertBuyMore = ({
if (!gasPriceError) return null;
return (
<Flex onClick={isCurrencySupported("BUY", account.currency) ? onBuyClick : undefined}>
<Alert type="warning">
<Alert type="warning" data-testid="insufficient-funds-warning">
<TranslatedError error={gasPriceError} />
</Alert>
</Flex>
Expand Down
6 changes: 3 additions & 3 deletions apps/ledger-live-desktop/tests/component/layout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Layout extends Component {

// general
readonly inputError = this.page.locator("id=input-error"); // no data-testid because css style is applied
readonly inputWarning = this.page.getByTestId("alert-insufficient-funds-warning");
readonly insufficientFundsWarning = this.page.getByTestId("insufficient-funds-warning");
private loadingSpinner = this.page.getByTestId("loading-spinner");
readonly logo = this.page.getByTestId("logo");

Expand Down Expand Up @@ -101,8 +101,8 @@ export class Layout extends Component {

@step("Check warning message")
async checkWarningMessage(expectedWarningMessage: RegExp) {
await this.inputWarning.waitFor({ state: "visible" });
const warningText = await this.inputWarning.innerText();
await expect(this.insufficientFundsWarning).toBeVisible();
const warningText = await this.insufficientFundsWarning.innerText();
expect(warningText).toMatch(expectedWarningMessage);
}

Expand Down

0 comments on commit 8d78fe6

Please sign in to comment.