Skip to content

Commit

Permalink
Mobile budget page menu VRT
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Sep 27, 2024
1 parent baa4312 commit 53ccc5e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/desktop-client/e2e/budget.mobile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ budgetTypes.forEach(budgetType => {
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking the Actual logo in the page header opens the budget page menu', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible({
timeout: 10000,
});

await budgetPage.openBudgetPageMenu();

const budgetPageMenuModal = page.getByRole('dialog');
const budgetPageMenuModalTitle =
budgetPageMenuModal.getByLabel('Modal logo');

await expect(budgetPageMenuModalTitle).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking the category group name opens the category group menu modal', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible({
Expand Down
5 changes: 5 additions & 0 deletions packages/desktop-client/e2e/page-models/mobile-budget-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class MobileBudgetPage {
this.selectedBudgetMonthButton = this.heading.getByLabel(
'Selected budget month',
);
this.budgetPageMenuButton = page.getByLabel('Budget page menu');

this.budgetTableHeader = page.getByTestId('budget-table-header');

Expand Down Expand Up @@ -74,6 +75,10 @@ export class MobileBudgetPage {
throw new Error('Budgeted/Spent columns could not be located on the page');
}

async openBudgetPageMenu() {
await this.budgetPageMenuButton.click();
}

async getCategoryGroupNameForRow(idx) {
return this.categoryGroupNames.nth(idx).textContent();
}
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ export function ModalHeader({
>
{showLogo && (
<SvgLogo
aria-label="Modal logo"
width={30}
height={30}
style={{ justifyContent: 'center', alignSelf: 'center' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,7 @@ export function BudgetTable({
variant="bare"
style={{ margin: 10 }}
onPress={onOpenBudgetPageMenu}
aria-label="Budget page menu"
>
<SvgLogo
style={{ color: theme.mobileHeaderText }}
Expand Down

0 comments on commit 53ccc5e

Please sign in to comment.