Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Mobile VRTs #3505

Closed
wants to merge 3 commits into from
Closed

[WIP] Mobile VRTs #3505

wants to merge 3 commits into from

Conversation

joel-jeremy
Copy link
Contributor

No description provided.

@actual-github-bot actual-github-bot bot changed the title Mobile VRTs [WIP] Mobile VRTs Sep 25, 2024
Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Warning

Rate limit exceeded

@joel-jeremy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between 760988f and 1bc77b5.

Walkthrough

The pull request introduces a comprehensive suite of end-to-end tests for mobile account and budgeting functionalities using Playwright. It includes new test files for accounts, budgeting, and settings, along with modifications to existing page models and components. Key changes involve the addition of new methods for managing budgets, improvements in accessibility through aria-label attributes, and updates to variable naming for clarity. Overall, the changes enhance the testing framework and improve the structure and usability of the mobile application.

Changes

File Path Change Summary
packages/desktop-client/e2e/accounts.mobile.test.js Introduced a new test suite for mobile accounts, verifying account page loading, balance checks, and transaction visibility.
packages/desktop-client/e2e/budget.mobile.test.js Added end-to-end tests for mobile budgeting, structured into "Envelope" and "Tracking" suites, covering budget interactions and visibility of elements.
packages/desktop-client/e2e/page-models/mobile-account-page.js Renamed variables in MobileAccountPage for clarity, enhancing code readability without changing functionality.
packages/desktop-client/e2e/page-models/mobile-budget-page.js Expanded MobileBudgetPage with new methods for budget management, including toggling column visibility and opening menus.
packages/desktop-client/e2e/page-models/settings-page.js Added a method for switching budget types and improved the experimental feature enabling method for better clarity.
packages/desktop-client/e2e/settings.mobile.test.js New test file for mobile settings functionality, verifying navigation and data export capabilities.
packages/desktop-client/e2e/transactions.mobile.test.js Streamlined the test suite by removing several tests, now focusing solely on transaction creation.
packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx Updated props and internal logic for BalanceWithCarryover, improving naming conventions and rendering logic.
packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx Changed disabled property to isDisabled for BalanceWithCarryover component.
packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx Added data-testid attributes for better testability and accessibility improvements across various components.
packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx Enhanced accessibility by adding aria-label attributes in the TransactionList component.
packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx Updated disabled prop to isDisabled in EnvelopeBalanceMenuModal.
packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx Added data-testid attribute for testing purposes.
packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx Renamed disabled prop to isDisabled in TrackingBalanceMenuModal.
packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx Added data-testid attribute for testing purposes.

Possibly related PRs

Suggested reviewers

  • carkom
  • MikesGlitch

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 1bc77b5
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66f47d95598a4b000851ce75
😎 Deploy Preview https://deploy-preview-3505.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Sep 25, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
9 5.29 MB → 5.29 MB (+163 B) +0.00%
Changeset
File Δ Size
src/components/budget/BalanceWithCarryover.tsx 📈 +157 B (+2.53%) 6.06 kB → 6.21 kB
src/components/modals/TrackingBalanceMenuModal.tsx 📈 +2 B (+0.08%) 2.5 kB → 2.5 kB
src/components/modals/EnvelopeBalanceMenuModal.tsx 📈 +2 B (+0.08%) 2.56 kB → 2.56 kB
src/components/budget/tracking/TrackingBudgetComponents.tsx 📈 +2 B (+0.01%) 13.05 kB → 13.05 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.31 MB → 3.31 MB (+163 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 80.41 kB 0%
static/js/usePreviewTransactions.js 1.59 kB 0%
static/js/AppliedFilters.js 20.97 kB 0%
static/js/wide.js 225.27 kB 0%
static/js/ReportRouter.js 1.5 MB 0%

Copy link
Contributor

github-actions bot commented Sep 25, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.19 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.19 MB 0%

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Outside diff range and nitpick comments (22)
packages/desktop-client/e2e/page-models/settings-page.js (2)

10-18: LGTM! Consider adding error handling and success verification.

The useBudgetType method is well-structured and follows good practices. It effectively enables the experimental feature and switches to the specified budget type.

Consider the following improvements:

  1. Add a check to see if the 'Budget mode toggle' is already enabled before calling enableExperimentalFeature.
  2. Implement error handling in case the switch button is not found.
  3. Add a verification step to ensure the budget type was successfully switched.

Here's a potential implementation:

async useBudgetType(budgetType) {
  if (!(await this.isExperimentalFeatureEnabled('Budget mode toggle'))) {
    await this.enableExperimentalFeature('Budget mode toggle');
  }

  const switchBudgetTypeButton = this.page.getByRole('button', {
    name: `Switch to ${budgetType} budgeting`,
  });

  if (await switchBudgetTypeButton.isVisible()) {
    await switchBudgetTypeButton.click();
    
    // Verify the switch was successful
    const newBudgetTypeIndicator = this.page.getByText(`Using ${budgetType} budgeting`);
    await expect(newBudgetTypeIndicator).toBeVisible();
  } else {
    throw new Error(`Button to switch to ${budgetType} budgeting not found`);
  }
}

This implementation assumes the existence of an isExperimentalFeatureEnabled method, which you might need to add to the class.


20-32: LGTM! Consider adding error handling and improving toggle logic.

The modifications to enableExperimentalFeature improve its reliability by using more specific selectors. The use of getByTestId for buttons and getByRole for the checkbox is a good practice.

Consider the following improvements:

  1. Add error handling in case elements are not found.
  2. Verify that the feature was successfully enabled after clicking the checkbox.
  3. Check the current state of the checkbox before clicking to ensure we're enabling (not disabling) the feature.

Here's a potential implementation:

async enableExperimentalFeature(featureName) {
  const advancedSettingsButton = this.page.getByTestId('advanced-settings');
  await advancedSettingsButton.click();

  const experimentalSettingsButton = this.page.getByTestId('experimental-settings');
  await experimentalSettingsButton.click();

  const featureCheckbox = this.page.getByRole('checkbox', { name: featureName });
  
  // Check if the checkbox is already checked
  const isChecked = await featureCheckbox.isChecked();
  if (!isChecked) {
    await featureCheckbox.click();
    
    // Verify the checkbox is now checked
    await expect(featureCheckbox).toBeChecked();
  }

  // Additional verification could be added here to ensure the feature is actually enabled
}

This implementation adds checks to ensure we're enabling the feature and verifies the checkbox state after clicking. You might also want to add try-catch blocks for error handling if necessary.

packages/desktop-client/e2e/settings.mobile.test.js (2)

6-22: Consider adjusting the viewport size for better mobile coverage.

The test setup is well-structured and appropriate for mobile testing. However, the viewport size (350x600) seems quite small, even for mobile devices. Consider using a slightly larger size to cover more modern mobile devices, or implement multiple viewport sizes for better coverage.

For example, you could use:

await page.setViewportSize({
  width: 375,
  height: 667,
});

This size corresponds to iPhone 6/7/8, which is a common reference point for mobile designs.


28-42: LGTM: Comprehensive test case with a suggestion for improvement.

The test case effectively checks navigation to the settings page and the data export functionality. The use of visual regression testing and verification of the exported file name are good practices.

Suggestion for improvement: Consider adding a check for the contents of the exported file, if possible. This would ensure not just that a file is exported, but that it contains the expected data.

Example pseudo-code:

const fileContents = await readExportedFile(download);
expect(fileContents).toContain(expectedData);

This would provide an additional layer of validation for the export functionality.

packages/desktop-client/e2e/accounts.mobile.test.js (4)

1-26: LGTM! Consider extracting viewport size to a constant.

The test setup is well-structured and follows best practices. The use of page models promotes code reusability, and the beforeEach and afterEach hooks ensure a clean state for each test.

Consider extracting the viewport size to a constant at the top of the file for easier maintenance:

const MOBILE_VIEWPORT = { width: 350, height: 600 };

// Then in beforeEach:
await page.setViewportSize(MOBILE_VIEWPORT);

28-36: LGTM! Consider using a more robust method to select the account.

The test effectively verifies the basic functionality of the accounts page, including both text content and visual appearance.

To improve test robustness, consider selecting the account by name instead of index:

const account = await accountsPage.getAccountByName('Ally Savings');

This change would make the test less susceptible to failures if the order of accounts changes. You'll need to implement the getAccountByName method in your accountsPage model.


38-46: LGTM! Consider improvements for robustness and specificity.

The test setup is thorough and covers important aspects of the individual account page.

  1. Similar to the previous test, consider selecting the account by name for improved robustness:
const accountPage = await accountsPage.openAccountByName('Bank of America');
  1. For the balance check, consider using a more specific assertion if possible:
await expect(await accountPage.getBalance()).toEqual(expectedBalance);

Where expectedBalance is a known value for this test account. This would make the test more sensitive to unexpected changes in the account balance.


53-56: LGTM! Consider adding more specific assertions.

This part of the test effectively verifies that transactions are found when searching for 'Kroger'.

To make the test more robust and informative, consider adding more specific assertions:

  1. Check for a minimum number of expected transactions:
await expect(accountPage.transactions).toHaveCount(atLeast(1));
  1. Verify that the displayed transactions contain 'Kroger':
const transactions = await accountPage.getTransactions();
await expect(transactions.some(t => t.includes('Kroger'))).toBeTruthy();

These additions would provide more confidence that the search is working as expected and returning relevant results.

packages/desktop-client/e2e/transactions.mobile.test.js (2)

6-6: Approve the updated test suite description with a minor suggestion.

The change from "Mobile" to "Mobile Transactions" provides a more accurate description of the test suite's current focus. This aligns well with the streamlined set of tests.

Consider adding more specificity to the description, such as "Mobile Transaction Creation" to precisely reflect the current test coverage.


Line range hint 28-89: Approve the remaining transaction creation tests with a suggestion for enhancement.

The two remaining tests for transaction creation are comprehensive and cover different entry points (via footer button and from an account page). They include appropriate checks for UI elements, data entry, and result verification.

To further enhance these tests, consider adding negative test cases or edge cases. For example:

  1. Attempting to create a transaction with invalid data (e.g., negative amounts, extremely large numbers).
  2. Testing the behavior when required fields are left empty.
  3. Verifying error messages for invalid inputs.

These additions would improve the robustness of the transaction creation tests.

packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx (2)

102-102: Approve the addition of data-testid attribute

The addition of the data-testid="budget-amount" attribute to the FocusableAmountInput component is a good practice. It enhances the testability of the component by providing a stable selector for end-to-end or integration tests.

Consider using a more specific test ID to avoid potential conflicts in larger test suites. For example:

-data-testid="budget-amount"
+data-testid="envelope-budget-amount-input"

This change would make the test ID more unique and descriptive, potentially reducing the risk of selector conflicts in your test suite.


Line range hint 86-102: Enhance accessibility of the budget input

While the component is well-structured, we can improve its accessibility by adding an aria-label to the FocusableAmountInput. This will provide better context for screen readers.

Consider adding an aria-label to the FocusableAmountInput:

 <FocusableAmountInput
   value={integerToAmount(budgeted || 0)}
   focused={amountFocused}
   onFocus={() => setAmountFocused(true)}
   onBlur={() => setAmountFocused(false)}
   onEnter={close}
   zeroSign="+"
   focusedStyle={{
     width: 'auto',
     padding: '5px',
     paddingLeft: '20px',
     paddingRight: '20px',
     minWidth: '100%',
   }}
   textStyle={{ ...styles.veryLargeText, textAlign: 'center' }}
   onUpdateAmount={_onUpdateBudget}
   data-testid="budget-amount"
+  aria-label={`Budget amount for ${category.name}`}
 />

This change will improve the user experience for those using screen readers by providing clear context about the input's purpose.

packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx (3)

102-102: Approve the addition of data-testid attribute

The addition of the data-testid="budget-amount" attribute to the FocusableAmountInput component is a good practice for improving testability. This will make it easier to select and interact with this specific element in automated tests.

Consider using a more specific test ID to avoid potential conflicts in larger test suites. For example:

-data-testid="budget-amount"
+data-testid="tracking-budget-modal-amount-input"

This change would make the test ID more unique and descriptive of its location within the component hierarchy.


Line range hint 52-54: Consider adding type safety to _onUpdateBudget function

The _onUpdateBudget function uses the any type implicitly for its amount parameter. To improve type safety, consider explicitly typing this parameter.

Here's a suggested improvement:

- const _onUpdateBudget = (amount: number) => {
+ const _onUpdateBudget = (amount: number) => {
    onUpdateBudget?.(amountToInteger(amount));
  };

This change ensures that only number values can be passed to the function, preventing potential type-related bugs.


Line range hint 61-63: Add error handling for null category

The component returns null if the category is not found, but it doesn't provide any feedback to the user. Consider adding an error message or fallback UI for this case.

Here's a suggested improvement:

  if (!category) {
-   return null;
+   return <Text>Error: Category not found</Text>;
  }

This change provides feedback to the user when the category is not available, improving the user experience.

packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx (1)

111-111: Approved: Consistent capitalization in aria-label

The capitalization of "Transaction list" in the aria-label attribute improves consistency in the labeling convention. This change, while minor, contributes to a more polished user interface.

Consider using a more descriptive label that includes the number of transactions, such as "List of X transactions". This would provide users with more context about the content they're interacting with.

packages/desktop-client/e2e/page-models/mobile-budget-page.js (2)

17-35: Inconsistent selector usage in toggleVisibleColumns method.

In the toggleVisibleColumns method, the Budgeted button is selected using this.budgetTableHeader.getByRole(...), while the Spent button is selected using this.page.getByRole(...). For consistency and to ensure accurate scoping, consider using this.budgetTableHeader.getByRole(...) for the Spent button as well, unless there is a specific reason for the different scopes.

Apply this change for consistency:

- const spentHeaderButton = this.page.getByRole('button', { name: 'Spent' });
+ const spentHeaderButton = this.budgetTableHeader.getByRole('button', { name: 'Spent' });

66-72: Ensure input field focus before typing in setBudget method.

After clicking the budgeted button in setBudget, ensure the input field is focused before typing newAmount. This can prevent potential issues if the input does not automatically receive focus.

You can explicitly focus the input field:

await budgetedButton.click();

+ const inputField = this.page.getByRole('textbox');
+ await inputField.focus();

await this.page.keyboard.type(String(newAmount));
await this.page.keyboard.press('Enter');
packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (2)

Line range hint 1-1: Enable TypeScript strict mode for better type safety

The file begins with // @ts-strict-ignore, which disables TypeScript's strict mode. Enabling strict mode can help catch type errors at compile time, enhancing code reliability and maintainability. It is advisable to address any existing type issues and remove this directive to benefit from stricter type checking.


123-137: Simplify the getDefaultClassName function

The getDefaultClassName function wraps the result of css() with String(). If css() already returns a string representing the class name, the String() conversion may be redundant. Consider removing String() to streamline the function unless there is a specific reason for this casting.

packages/desktop-client/e2e/budget.mobile.test.js (2)

99-100: Ensure consistency between code and comments

The comment // Set to 100.00 suggests setting the budget to 100.00, but the code sets it to 10000. To improve clarity, consider updating the comment or the code so they match. If 10000 represents 100.00, consider using a helper function or constant to make this clear.

Also applies to: 231-232


100-104: Clarify amount representation in budget setting

When setting the budgeted amount using await budgetPage.setBudget('Food', 10000);, it's not immediately clear that 10000 represents 100.00. To enhance readability, consider defining a constant or using a helper function to represent monetary values, making the code more understandable.

Also applies to: 232-236

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fe17c6b and 760988f.

🔇 Files ignored due to path filters (103)
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-9-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--14404-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--321fd-ed-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--4bb70-ed-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a85-ed-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bed18-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--c18ad-l-redirects-to-the-category-transactions-page-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ceb3a-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--e995e-l-redirects-to-the-category-transactions-page-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ff568-l-redirects-to-the-category-transactions-page-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--11290-l-redirects-to-the-category-transactions-page-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--42062-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--49fb6-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--57d88-l-redirects-to-the-category-transactions-page-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--5d90c-l-redirects-to-the-category-transactions-page-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--730ef-ng-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--b1562-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--c3fb8-ng-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking--d9705-ng-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-balance-button-opens-the-balance-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-updates-the-budgeted-amount-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-updates-the-budgeted-amount-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.mobile.test.js-snapshots/Mobile-Budget-Tracking-updates-the-budgeted-amount-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.js-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.js-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-from-accounts-id-page-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-creates-a-transaction-via-footer-button-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/onboarding.test.js-snapshots/Onboarding-checks-the-page-visuals-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-checks-the-page-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/settings.mobile.test.js-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-from-accounts-id-page-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-from-accounts-id-page-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-from-accounts-id-page-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.mobile.test.js-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-9-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-6-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/3492.md is excluded by !**/*.md
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • packages/desktop-client/e2e/accounts.mobile.test.js (1 hunks)
  • packages/desktop-client/e2e/budget.mobile.test.js (1 hunks)
  • packages/desktop-client/e2e/page-models/mobile-account-page.js (1 hunks)
  • packages/desktop-client/e2e/page-models/mobile-budget-page.js (1 hunks)
  • packages/desktop-client/e2e/page-models/settings-page.js (1 hunks)
  • packages/desktop-client/e2e/settings.mobile.test.js (1 hunks)
  • packages/desktop-client/e2e/transactions.mobile.test.js (1 hunks)
  • packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (4 hunks)
  • packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx (1 hunks)
  • packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx (8 hunks)
  • packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx (2 hunks)
  • packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/desktop-client/e2e/page-models/mobile-account-page.js
🔇 Additional comments not posted (15)
packages/desktop-client/e2e/settings.mobile.test.js (2)

1-5: LGTM: Imports and setup look good.

The necessary modules are imported from Playwright, and custom page models are used, which is a good practice for maintainability and reusability in end-to-end tests.


24-26: LGTM: Proper test teardown.

Closing the page after each test is a good practice. It ensures proper cleanup of resources and helps maintain test isolation.

packages/desktop-client/e2e/accounts.mobile.test.js (2)

48-51: LGTM! Comprehensive check for the "no results" scenario.

This part of the test effectively verifies the behavior when no transactions are found. It checks both UI elements (no transactions message) and data (transaction count), and includes a visual regression test.


1-57: Overall, well-structured and comprehensive test suite for mobile accounts.

This test file effectively covers key functionality of the mobile accounts feature, including account balance display and transaction filtering. The use of page models, before/after hooks, and visual regression tests are commendable practices.

The suggested improvements, such as using more robust account selection methods and more specific assertions, will further enhance the reliability and effectiveness of these tests.

Great job on implementing these end-to-end tests for the mobile experience!

packages/desktop-client/e2e/transactions.mobile.test.js (1)

Line range hint 1-89: Clarify the rationale behind removing multiple tests.

I've noticed that several tests have been removed from this suite, including those for budget page loading, accounts page opening, and settings page accessibility. While this focuses the suite on transaction creation, it also significantly reduces the overall test coverage.

Could you please clarify the reasoning behind these removals? Are these functionalities being tested elsewhere, or is there a specific strategy that led to this decision?

To help verify the current state of testing, please run the following script:

This will help us understand if the removed tests are covered in other files or if additional test coverage might be needed.

✅ Verification successful

Test coverage remains comprehensive with existing tests covering budget, account, and settings functionalities. No issues found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for other test files that might cover the removed functionalities

echo "Searching for other mobile test files:"
fd -e js -e ts --full-path '.*mobile.*test' packages/desktop-client/e2e

echo "\nSearching for budget-related tests:"
rg -i 'test.*budget' packages/desktop-client/e2e

echo "\nSearching for account-related tests:"
rg -i 'test.*account' packages/desktop-client/e2e

echo "\nSearching for settings-related tests:"
rg -i 'test.*settings' packages/desktop-client/e2e

Length of output: 7389

packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx (1)

67-67: Prop renamed for improved clarity

The prop disabled has been renamed to isDisabled in the BalanceWithCarryover component. This change aligns with React's best practices for boolean prop naming, which suggests using "is" or "has" prefixes for boolean props to improve readability and self-documentation.

To ensure consistency across the codebase, let's check if this change has been applied uniformly:

This script will help us identify if there are any inconsistencies in the usage of this prop across the project.

packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx (1)

69-69: Improved prop naming convention

The change from disabled to isDisabled improves readability and follows React best practices for boolean prop naming. This is a good improvement.

To ensure consistency across the codebase, please run the following script to check for other occurrences of the BalanceWithCarryover component and verify if they need similar updates:

Additionally, consider reviewing the hardcoded true value for isDisabled. If this prop should be dynamic, you might want to pass a variable or a condition instead.

✅ Verification successful

Prop renaming verified successfully

All instances of the BalanceWithCarryover component have been updated to use the isDisabled prop consistently. No occurrences of the old disabled prop were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all occurrences of BalanceWithCarryover component
# and check for 'disabled' prop usage

# Search for BalanceWithCarryover usage
echo "Searching for BalanceWithCarryover usage:"
rg --type typescript --type tsx "BalanceWithCarryover" -A 10 -B 2

# Search for the BalanceWithCarryover component definition
echo "Searching for BalanceWithCarryover component definition:"
rg --type typescript --type tsx "function BalanceWithCarryover" -A 20

Length of output: 423


Script:

#!/bin/bash
# Description: Find all occurrences of BalanceWithCarryover component
# and check for 'isDisabled' prop usage with corrected file types

# Search for BalanceWithCarryover usage in .ts and .tsx files
echo "Searching for BalanceWithCarryover usage in TypeScript files:"
rg --type ts --type tsx "BalanceWithCarryover" -A 10 -B 2

# Search for the BalanceWithCarryover component definition in .ts and .tsx files
echo "Searching for BalanceWithCarryover component definition in TypeScript files:"
rg --type ts --type tsx "function BalanceWithCarryover" -A 20

Length of output: 473


Script:

#!/bin/bash
# Description: Find all occurrences of BalanceWithCarryover component
# and check for 'isDisabled' prop usage in .ts and .tsx files

# Search for BalanceWithCarryover usage in .ts and .tsx files
echo "Searching for BalanceWithCarryover usage in TypeScript files:"
rg "BalanceWithCarryover" -g "*.ts" -g "*.tsx" -A 10 -B 2

# Search for the BalanceWithCarryover component definition in .ts and .tsx files
echo "Searching for BalanceWithCarryover component definition in TypeScript files:"
rg "function BalanceWithCarryover" -g "*.ts" -g "*.tsx" -A 20

Length of output: 21496

packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx (1)

401-401: LGTM! Verify BalanceWithCarryover component for consistency.

The change from disabled to isDisabled aligns with React naming conventions for boolean props. This improves code readability and consistency.

To ensure this change doesn't introduce any issues, please verify that the BalanceWithCarryover component has been updated to expect isDisabled instead of disabled. Run the following script to check for any remaining usage of the disabled prop in the BalanceWithCarryover component:

✅ Verification successful

Verification Successful: The disabled prop has been fully replaced with isDisabled in the BalanceWithCarryover component. No remaining instances of disabled were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for 'disabled' prop usage in BalanceWithCarryover component

# Search for the BalanceWithCarryover component definition
echo "Searching for BalanceWithCarryover component definition:"
rg --type typescript "export (const|function) BalanceWithCarryover" -A 10

# Search for any remaining usage of 'disabled' prop within the component
echo "\nSearching for 'disabled' prop usage in BalanceWithCarryover:"
rg --type typescript "disabled(\s*):(\s*)" -g "*BalanceWithCarryover*"

Length of output: 482


Script:

#!/bin/bash
# Description: Check for 'disabled' prop usage in BalanceWithCarryover component

# Search for the BalanceWithCarryover component definition
echo "Searching for BalanceWithCarryover component definition in .tsx files:"
rg "export (const|function) BalanceWithCarryover" -g "*.tsx" -A 10

# Search for any remaining usage of 'disabled' prop within the component
echo "\nSearching for 'disabled' prop usage in BalanceWithCarryover within .tsx files:"
rg "disabled\s*=" -g "*.tsx" | grep "BalanceWithCarryover"

Length of output: 1472

packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx (2)

94-94: Excellent addition for accessibility!

The aria-label="Loading..." attribute enhances the user experience for screen reader users by providing clear feedback when the content is loading. This change aligns with web accessibility best practices.


Line range hint 1-489: Overall assessment: Well-structured component with improved accessibility

The TransactionList component is well-organized and follows React best practices. The recent changes focus on enhancing accessibility, which is commendable. The component handles complex logic for rendering transactions and user interactions effectively.

Consider adding more accessibility features in the future, such as keyboard navigation support and ARIA attributes for interactive elements within the transaction list.

packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx (4)

282-286: Improved testability with data-testid attributes

The addition of data-testid attributes to the CellValue components and buttons in the ExpenseCategory component is a positive change. These unique identifiers will greatly enhance the ability to select specific elements during testing, making the tests more robust and easier to maintain.

Also applies to: 303-303, 604-608, 616-616


1924-1924: Enhanced accessibility and testability in MonthSelector

The addition of aria-label attributes to the previous and next month buttons in the MonthSelector component is a great improvement for accessibility. This change allows screen readers to properly announce the purpose of these buttons. Additionally, the data-testid attribute added to the month button enhances testability. These modifications contribute to a more inclusive and testable user interface.

Also applies to: 1946-1946, 1953-1953


1702-1702: Improved testability for BudgetTableHeader

The addition of a data-testid attribute to the main View component of the BudgetTableHeader is a positive change. This unique identifier will make it easier to select and interact with the BudgetTableHeader component during testing, enhancing the overall testability of the component.


Line range hint 1-1965: Overall improvements in testability and accessibility

The changes made to this file consistently enhance both testability and accessibility across multiple components. The addition of data-testid attributes improves the ability to select specific elements during testing, while the new aria-label attributes in the MonthSelector component improve screen reader support. These modifications contribute to a more robust, maintainable, and inclusive codebase without altering the core functionality of the components.

packages/desktop-client/e2e/page-models/mobile-budget-page.js (1)

12-14: Initialization of new properties is appropriate.

The properties budgetTableHeader, budgetTable, and navigation are correctly initialized in the constructor, enhancing the page model's capabilities for budget interactions.

@@ -99,6 +99,7 @@ export function TrackingBudgetMenuModal({
}}
textStyle={{ ...styles.veryLargeText, textAlign: 'center' }}
onUpdateAmount={_onUpdateBudget}
data-testid="budget-amount"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance accessibility with aria-label

While adding the data-testid attribute is great for testing, consider also adding an aria-label to improve accessibility for screen readers.

Here's a suggested improvement:

  data-testid="budget-amount"
+ aria-label={`Budget amount for ${category.name}`}

This change provides more context to screen reader users about the purpose of this input field.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data-testid="budget-amount"
data-testid="budget-amount"
aria-label={`Budget amount for ${category.name}`}

Comment on lines 112 to 128
async openEnvelopeBudgetSummaryMenu() {
const toBudgetButton = this.page.getByRole('button', { name: 'To Budget' });

if ((await toBudgetButton.count()) > 0) {
await toBudgetButton.click();
return;
}

const overbudgetedButton = this.page.getByRole('button', {
name: 'Overbudgeted',
});

if ((await overbudgetedButton.count()) > 0) {
await overbudgetedButton.click();
return;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Handle the case when no summary buttons are found in openEnvelopeBudgetSummaryMenu.

If neither the 'To Budget' nor 'Overbudgeted' buttons are found, the method exits silently without any action. Adding error handling will assist in identifying unexpected UI changes.

Consider adding an error throw:

...
    if ((await overbudgetedButton.count()) > 0) {
      await overbudgetedButton.click();
      return;
    }

+   throw new Error('No summary button found in openEnvelopeBudgetSummaryMenu');
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async openEnvelopeBudgetSummaryMenu() {
const toBudgetButton = this.page.getByRole('button', { name: 'To Budget' });
if ((await toBudgetButton.count()) > 0) {
await toBudgetButton.click();
return;
}
const overbudgetedButton = this.page.getByRole('button', {
name: 'Overbudgeted',
});
if ((await overbudgetedButton.count()) > 0) {
await overbudgetedButton.click();
return;
}
}
async openEnvelopeBudgetSummaryMenu() {
const toBudgetButton = this.page.getByRole('button', { name: 'To Budget' });
if ((await toBudgetButton.count()) > 0) {
await toBudgetButton.click();
return;
}
const overbudgetedButton = this.page.getByRole('button', {
name: 'Overbudgeted',
});
if ((await overbudgetedButton.count()) > 0) {
await overbudgetedButton.click();
return;
}
throw new Error('No summary button found in openEnvelopeBudgetSummaryMenu');
}

Comment on lines 130 to 154
async openTrackingBudgetSummaryMenu() {
const savedButton = this.page.getByRole('button', { name: 'Saved' });

if ((await savedButton.count()) > 0) {
await savedButton.click();
return;
}

const projectedSavingsButton = this.page.getByRole('button', {
name: 'Projected Savings',
});

if ((await projectedSavingsButton.count()) > 0) {
await projectedSavingsButton.click();
return;
}

const overspentButton = this.page.getByRole('button', {
name: 'Overspent',
});

if ((await overspentButton.count()) > 0) {
await overspentButton.click();
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Handle the case when no summary buttons are found in openTrackingBudgetSummaryMenu.

Similarly, in openTrackingBudgetSummaryMenu, if none of the buttons ('Saved', 'Projected Savings', 'Overspent') are found, the method does nothing. Adding error handling will help in debugging and ensuring the method behaves as expected.

Consider adding an error throw:

...
    if ((await overspentButton.count()) > 0) {
      await overspentButton.click();
      return;
    }

+   throw new Error('No summary button found in openTrackingBudgetSummaryMenu');
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async openTrackingBudgetSummaryMenu() {
const savedButton = this.page.getByRole('button', { name: 'Saved' });
if ((await savedButton.count()) > 0) {
await savedButton.click();
return;
}
const projectedSavingsButton = this.page.getByRole('button', {
name: 'Projected Savings',
});
if ((await projectedSavingsButton.count()) > 0) {
await projectedSavingsButton.click();
return;
}
const overspentButton = this.page.getByRole('button', {
name: 'Overspent',
});
if ((await overspentButton.count()) > 0) {
await overspentButton.click();
return;
}
async openTrackingBudgetSummaryMenu() {
const savedButton = this.page.getByRole('button', { name: 'Saved' });
if ((await savedButton.count()) > 0) {
await savedButton.click();
return;
}
const projectedSavingsButton = this.page.getByRole('button', {
name: 'Projected Savings',
});
if ((await projectedSavingsButton.count()) > 0) {
await projectedSavingsButton.click();
return;
}
const overspentButton = this.page.getByRole('button', {
name: 'Overspent',
});
if ((await overspentButton.count()) > 0) {
await overspentButton.click();
return;
}
throw new Error('No summary button found in openTrackingBudgetSummaryMenu');
}

Comment on lines 37 to 59
async getBudgetedButton(categoryName) {
let budgetedButton = this.page.getByTestId(
`budgeted-${categoryName}-button`,
);

if ((await budgetedButton.count()) > 0) {
return budgetedButton;
}

await this.toggleVisibleColumns();
budgetedButton = await this.getBudgetedButton(categoryName);

if (
(await budgetedButton.count()) > 0 &&
(await budgetedButton.isVisible())
) {
return budgetedButton;
}

throw new Error(
`Budget button for category ${categoryName} could not be located`,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Refactor recursion in getBudgetedButton method to an iterative approach.

The getBudgetedButton method uses recursion after toggling columns if the button is not found initially. Refactoring to an iterative approach can enhance readability and prevent potential stack overflow issues.

Apply this refactor:

async getBudgetedButton(categoryName) {
  let budgetedButton = this.page.getByTestId(`budgeted-${categoryName}-button`);

+ for (let attempts = 0; attempts < 2; attempts++) {
+   if ((await budgetedButton.count()) > 0 && (await budgetedButton.isVisible())) {
+     return budgetedButton;
+   }
+   await this.toggleVisibleColumns();
+   budgetedButton = this.page.getByTestId(`budgeted-${categoryName}-button`);
+ }

  throw new Error(
    `Budget button for category ${categoryName} could not be located`,
  );
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async getBudgetedButton(categoryName) {
let budgetedButton = this.page.getByTestId(
`budgeted-${categoryName}-button`,
);
if ((await budgetedButton.count()) > 0) {
return budgetedButton;
}
await this.toggleVisibleColumns();
budgetedButton = await this.getBudgetedButton(categoryName);
if (
(await budgetedButton.count()) > 0 &&
(await budgetedButton.isVisible())
) {
return budgetedButton;
}
throw new Error(
`Budget button for category ${categoryName} could not be located`,
);
}
async getBudgetedButton(categoryName) {
let budgetedButton = this.page.getByTestId(`budgeted-${categoryName}-button`);
for (let attempts = 0; attempts < 2; attempts++) {
if ((await budgetedButton.count()) > 0 && (await budgetedButton.isVisible())) {
return budgetedButton;
}
await this.toggleVisibleColumns();
budgetedButton = this.page.getByTestId(`budgeted-${categoryName}-button`);
}
throw new Error(
`Budget button for category ${categoryName} could not be located`,
);
}

Comment on lines +114 to 118
const getDifferenceToGoal = useCallback(
(balanceValue: number) =>
longGoalValue === 1
? balanceValue - goalValue
: budgetedValue - goalValue,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure safe handling of goalValue when it may be null or undefined

In the getDifferenceToGoal function, calculations involve goalValue, which might be null or undefined. If goalValue is null, operations like subtraction could result in NaN, leading to unexpected behavior in comparisons and rendering. Consider adding checks to ensure goalValue is a valid number before performing arithmetic operations.

Comment on lines 11 to 22
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();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Refactor shared setup code to eliminate duplication

The beforeEach functions in both test suites are nearly identical. Consider abstracting the common setup steps into a shared function or utilizing test hooks to reduce code duplication and improve maintainability.

Also applies to: 131-142

Comment on lines 24 to 26
test.afterEach(async () => {
await page.close();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Refactor shared teardown code to eliminate duplication

Similar to the setup functions, the afterEach functions in both test suites perform the same actions. Abstracting this into a shared teardown function can further reduce duplication.

Also applies to: 144-146

Comment on lines 31 to 48
await expect(budgetPage.categoryNames).toHaveText([
'Food',
'Restaurants',
'Entertainment',
'Clothing',
'General',
'Gift',
'Medical',
'Savings',
'Cell',
'Internet',
'Mortgage',
'Water',
'Power',
'Starting Balances',
'Misc',
'Income',
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid hardcoding category names in tests

Hardcoding category names makes the tests fragile to changes in the category list. Consider retrieving category names dynamically or using a fixture or test data file. This will make the tests more resilient to changes and easier to maintain.

Also applies to: 153-170

Comment on lines 6 to 118
});
await page.goto('/');
await configurationPage.createTestFile();
});

test.afterEach(async () => {
await page.close();
});

test('loads the budget page with budgeted amounts', async () => {
const budgetPage = await navigation.goToBudgetPage();

await expect(budgetPage.categoryNames).toHaveText([
'Food',
'Restaurants',
'Entertainment',
'Clothing',
'General',
'Gift',
'Medical',
'Savings',
'Cell',
'Internet',
'Mortgage',
'Water',
'Power',
'Starting Balances',
'Misc',
'Income',
]);
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking the budgeted cell opens the budget menu modal', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible();

await budgetPage.openBudgetMenu('Food');

const budgetMenuModal = page.getByTestId('envelope-budget-menu-modal');
await expect(budgetMenuModal).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking spent cell redirects to the category transactions page', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible();

const accountPage = await budgetPage.openSpentPage('Food');

await expect(accountPage.transactionList).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking the balance button opens the balance menu modal', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible();

await budgetPage.openBalanceMenu('Food');

const balanceMenuModal = page.getByTestId('envelope-balance-menu-modal');
await expect(balanceMenuModal).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});

test('checks that clicking the month in the page header opens the month menu modal', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible();

await budgetPage.openMonthMenu();

const monthMenuModal = page.getByTestId('envelope-budget-month-menu-modal');
await expect(monthMenuModal).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});

test('updates the budgeted amount', async () => {
const budgetPage = await navigation.goToBudgetPage();
await expect(budgetPage.budgetTable).toBeVisible();

// Set to 100.00
await budgetPage.setBudget('Food', 10000);

const budgetedButton = await budgetPage.getBudgetedButton('Food');

await expect(budgetedButton).toHaveText('100.00');

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

test('checks that clicking the To Budget/Overbudgeted amount opens the budget summary menu modal', async () => {
const budgetPage = await navigation.goToBudgetPage();

await budgetPage.openEnvelopeBudgetSummaryMenu();

const summaryModal = page.getByTestId('envelope-budget-summary-modal');
await expect(summaryModal).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Parameterize tests to handle multiple budget types

The test suites for 'Mobile Budget [Envelope]' and 'Mobile Budget [Tracking]' are very similar, with differences primarily in the budget type. Consider parameterizing the tests to handle both budget types within a single suite. This will reduce code duplication and simplify future test maintenance.

Also applies to: 120-253

Comment on lines 125 to 129
const setBudgetType = async budgetType => {
// Set budget type.
const settingsPage = await navigation.goToSettingsPage();
await settingsPage.useBudgetType(budgetType);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider moving utility functions outside the test suite

The setBudgetType function is defined within the 'Mobile Budget [Tracking]' test suite but may be useful elsewhere. Consider moving it outside the suite or into a utility module if it's needed in other tests, promoting reusability.

joel-jeremy and others added 3 commits September 25, 2024 14:03
…over.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant