mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -05:00
* 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>
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import { MobileTransactionEntryPage } from './mobile-transaction-entry-page';
|
|
|
|
export class MobileAccountPage {
|
|
constructor(page) {
|
|
this.page = page;
|
|
|
|
this.heading = page.getByRole('heading');
|
|
this.balance = page.getByTestId('transactions-balance');
|
|
this.noTransactionsMessage = page.getByText('No transactions');
|
|
this.searchBox = page.getByPlaceholder(/^Search/);
|
|
this.transactionList = page.getByLabel('Transaction list');
|
|
this.transactions = this.transactionList.getByRole('button');
|
|
this.createTransactionButton = page.getByRole('button', {
|
|
name: 'Add Transaction',
|
|
});
|
|
}
|
|
|
|
async waitFor() {
|
|
await this.transactionList.waitFor();
|
|
}
|
|
|
|
/**
|
|
* Retrieve the balance of the account as a number
|
|
*/
|
|
async getBalance() {
|
|
return parseInt(await this.balance.textContent(), 10);
|
|
}
|
|
|
|
/**
|
|
* Search by the given term
|
|
*/
|
|
async searchByText(term) {
|
|
await this.searchBox.fill(term);
|
|
}
|
|
|
|
async clearSearch() {
|
|
await this.searchBox.clear();
|
|
}
|
|
|
|
/**
|
|
* Go to transaction creation page
|
|
*/
|
|
async clickCreateTransaction() {
|
|
this.createTransactionButton.click();
|
|
return new MobileTransactionEntryPage(this.page);
|
|
}
|
|
}
|