mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-22 00:13:45 -05:00
* [AI] Desktop client, E2E, loot-core, sync-server and tooling updates Co-authored-by: Cursor <cursoragent@cursor.com> * Refactor database handling in various modules to use async/await for improved readability and error handling. This includes updates to database opening and closing methods across multiple files, ensuring consistent asynchronous behavior. Additionally, minor adjustments were made to encryption functions to support async operations. * Refactor sync migration tests to utilize async/await for improved readability. Updated transaction handling to streamline event expectations and cleanup process. * Refactor various functions to utilize async/await for improved readability and error handling. Updated service stopping, encryption, and file upload/download methods to ensure consistent asynchronous behavior across the application. * Refactor BudgetFileSelection component to use async/await for onSelect method, enhancing error handling and readability. Update merge tests to utilize async/await for improved clarity in transaction merging expectations. * Refactor filesystem module to use async/await for init function and related database operations, enhancing error handling and consistency across file interactions. Updated tests to reflect asynchronous behavior in database operations and file writing. * Fix typo in init function declaration to ensure it returns a Promise<void> instead of Proise<void>. * Update VRT screenshots Auto-generated by VRT workflow PR: #6987 * Update tests to use async/await for init function in web filesystem, ensuring consistent asynchronous behavior in database operations. * Update VRT screenshot for payees filter test to reflect recent changes * [AI] Fix no-floating-promises lint error in desktop-electron Wrapped queuedClientWinLogs.map() with Promise.all and void operator to properly handle the array of promises for executing queued logs. Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com> * Refactor promise handling in global and sync event handlers * Update VRT screenshots Auto-generated by VRT workflow PR: #6987 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>
66 lines
2.2 KiB
TypeScript
66 lines
2.2 KiB
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
import { expect, test } from './fixtures';
|
|
import { ConfigurationPage } from './page-models/configuration-page';
|
|
import { MobileNavigation } from './page-models/mobile-navigation';
|
|
|
|
test.describe('Mobile Accounts', () => {
|
|
let page: Page;
|
|
let navigation: MobileNavigation;
|
|
let configurationPage: ConfigurationPage;
|
|
|
|
test.beforeEach(async ({ browser }) => {
|
|
page = await browser.newPage();
|
|
navigation = new MobileNavigation(page);
|
|
configurationPage = new ConfigurationPage(page);
|
|
|
|
await page.setViewportSize({
|
|
width: 350,
|
|
height: 600,
|
|
});
|
|
await page.goto('/');
|
|
await configurationPage.createTestFile();
|
|
});
|
|
|
|
test.afterEach(async () => {
|
|
await page?.close();
|
|
});
|
|
|
|
test('opens the accounts page and asserts on balances', async () => {
|
|
const accountsPage = await navigation.goToAccountsPage();
|
|
await accountsPage.waitFor();
|
|
|
|
const account = await accountsPage.getNthAccount(1);
|
|
|
|
await expect(account.name).toHaveText('Ally Savings');
|
|
await expect(account.balance).toHaveText('7,653.00');
|
|
await expect(page).toMatchThemeScreenshots();
|
|
});
|
|
|
|
test('opens individual account page and checks that filtering is working', async () => {
|
|
const accountsPage = await navigation.goToAccountsPage();
|
|
await accountsPage.waitFor();
|
|
|
|
const accountPage = await accountsPage.openNthAccount(0);
|
|
await accountPage.waitFor();
|
|
|
|
await expect(accountPage.heading).toHaveText('Bank of America');
|
|
await expect(accountPage.transactionList).toBeVisible();
|
|
expect(await accountPage.getBalance()).toBeGreaterThan(0);
|
|
await expect(accountPage.noTransactionsMessage).not.toBeVisible();
|
|
await expect(page).toMatchThemeScreenshots();
|
|
|
|
await accountPage.searchByText('nothing should be found');
|
|
await expect(accountPage.noTransactionsMessage).toBeVisible();
|
|
await expect(accountPage.transactions).toHaveCount(0);
|
|
await expect(page).toMatchThemeScreenshots();
|
|
|
|
await accountPage.clearSearch();
|
|
await expect(accountPage.transactions).not.toHaveCount(0);
|
|
|
|
await accountPage.searchByText('Kroger');
|
|
await expect(accountPage.transactions).not.toHaveCount(0);
|
|
await expect(page).toMatchThemeScreenshots();
|
|
});
|
|
});
|