Files
actual/packages/desktop-client/e2e/page-models/mobile-accounts-page.js
Joel Jeremy Marquez 3cefd98ce9 useTransactions hook to simplify loading of transactions (#3685)
* useTransactions hook to load transactions

* Release notes + lint fix

* Update useQuery

* useTransactions update

* Stabilize tests

* Fx flaky test

* Fix tests

* Fix tests

* Update queries

* Apply coderabbit suggestions

* Fix onlySync

* Update useTransactions

* Code rabbit suggestions

* useTransactionsSearch hook

* Debounce the useTransactionsSearch search method

* usePreviewTransactions debounce fix

* Fix lint

* Coderabbit feedback + make useSchedules consistent with query pattern used in useTransactions

* Code review feedback and improve schedules loading

* Update error handling

* Cancel debounce on unmount

* Fix lint

* set loading state on error

* Fix test

* VRT

* Revert VRT

---------

Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
2024-11-11 22:41:42 -08:00

36 lines
776 B
JavaScript

import { MobileAccountPage } from './mobile-account-page';
export class MobileAccountsPage {
constructor(page) {
this.page = page;
this.accountList = this.page.getByLabel('Account list');
this.accounts = this.page.getByTestId('account');
}
async waitFor() {
await this.accountList.waitFor();
}
/**
* Get the name and balance of the nth account
*/
async getNthAccount(idx) {
const accountRow = this.accounts.nth(idx);
return {
name: accountRow.getByTestId('account-name'),
balance: accountRow.getByTestId('account-balance'),
};
}
/**
* Click on the n-th account to open it up
*/
async openNthAccount(idx) {
await this.accounts.nth(idx).click();
return new MobileAccountPage(this.page);
}
}