mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 18:20:24 -05:00
* Mobile category transactions * Release notes * Fix typo * Fix typecheck error * Handle null location state * VRT * Fix account search * Update test * Search placeholder * vrt * Add month to page title * Cleanup * Fix AccountName component * Replace ButtonLink with Link * Fix typecheck * Code review update
40 lines
1.1 KiB
JavaScript
40 lines
1.1 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.noTransactionsFoundError = 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',
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
|
|
/**
|
|
* Go to transaction creation page
|
|
*/
|
|
async clickCreateTransaction() {
|
|
this.createTransactionButton.click();
|
|
return new MobileTransactionEntryPage(this.page);
|
|
}
|
|
}
|