mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-22 00:13:45 -05:00
35 lines
887 B
TypeScript
35 lines
887 B
TypeScript
import { type Locator, type Page } from '@playwright/test';
|
|
|
|
import { EditNotesModal } from './mobile-edit-notes-modal';
|
|
|
|
export class CategoryMenuModal {
|
|
readonly page: Page;
|
|
readonly locator: Locator;
|
|
readonly heading: Locator;
|
|
readonly budgetAmountInput: Locator;
|
|
readonly editNotesButton: Locator;
|
|
|
|
constructor(locator: Locator) {
|
|
this.locator = locator;
|
|
this.page = locator.page();
|
|
|
|
this.heading = locator.getByRole('heading');
|
|
this.budgetAmountInput = locator.getByTestId('amount-input');
|
|
this.editNotesButton = locator.getByRole('button', { name: 'Edit notes' });
|
|
}
|
|
|
|
async close() {
|
|
await this.heading.getByRole('button', { name: 'Close' }).click();
|
|
}
|
|
|
|
async editNotes() {
|
|
await this.editNotesButton.click();
|
|
|
|
return new EditNotesModal(
|
|
this.page.getByRole('dialog', {
|
|
name: 'Modal dialog',
|
|
}),
|
|
);
|
|
}
|
|
}
|