Files
actual/packages/desktop-client/e2e/page-models/configuration-page.ts
Matiss Janis Aboltins 541df52441 Enable restrict-template-expressions linting rule (#7181)
* [AI] Promote typescript/restrict-template-expressions to error and fix violations

Convert the oxlint rule from "warn" to "error" and fix all 42 violations
by wrapping non-string template expressions with String(). This ensures
type safety in template literals across the codebase.

https://claude.ai/code/session_01Uk8SwFbD6HuUuo3SSMwU9z

* Add release notes for PR #7181

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-13 18:36:58 +00:00

73 lines
2.0 KiB
TypeScript

import type { Locator, Page } from '@playwright/test';
import { AccountPage } from './account-page';
import { BudgetPage } from './budget-page';
export class ConfigurationPage {
readonly page: Page;
readonly heading: Locator;
constructor(page: Page) {
this.page = page;
this.heading = page.getByRole('heading');
}
async createTestFile() {
await this.page.getByRole('button', { name: 'Create test file' }).click();
return new BudgetPage(this.page);
}
async clickOnNoServer() {
await this.page.getByRole('button', { name: "Don't use a server" }).click();
}
async startFresh() {
await this.page.getByRole('button', { name: 'Start fresh' }).click();
return new AccountPage(this.page);
}
async importBudget(type: 'YNAB4' | 'nYNAB' | 'Actual', file: string) {
const fileChooserPromise = this.page.waitForEvent('filechooser');
await this.page.getByRole('button', { name: 'Import my budget' }).click();
switch (type) {
case 'YNAB4':
await this.page
.getByRole('button', {
name: 'YNAB4 The old unsupported desktop app',
})
.click();
await this.page
.getByRole('button', { name: 'Select zip file...' })
.click();
break;
case 'nYNAB':
await this.page
.getByRole('button', { name: 'nYNAB The newer web app' })
.click();
await this.page.getByRole('button', { name: 'Select file...' }).click();
break;
case 'Actual':
await this.page
.getByRole('button', {
name: 'Actual Import a file exported from Actual',
})
.click();
await this.page.getByRole('button', { name: 'Select file...' }).click();
break;
default:
throw new Error(`Unrecognized import type: ${String(type)}`);
}
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(file);
return new BudgetPage(this.page);
}
}