[PR #6208] [MERGED] Fix flaky cash flow chart e2e test by disabling animations #55690

Closed
opened 2026-05-01 02:53:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6208
Author: @MatissJanis
Created: 11/19/2025
Status: Merged
Merged: 11/19/2025
Merged by: @MatissJanis

Base: masterHead: matiss/fix-cash-flow-chart-animation-e2e


📝 Commits (5)

  • a88ae3c Fix flaky cash flow chart e2e test by disabling animations in test environment
  • c6ae299 Add release notes for stabilization of VRT tests related to cashflow report
  • d4a8bf1 Update VRT screenshots
  • 4f730fd Run CI
  • 8b9fade Remove unused isTestEnv hook and related animation logic

📊 Changes

2 files changed (+6 additions, -0 deletions)

View changed files

📝 packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png (+0 -0)
upcoming-release-notes/6208.md (+6 -0)

📄 Description

Problem

The cash flow graph e2e test was flaky, with bar chart heights sometimes appearing at 10px and sometimes smaller. This only occurred in light mode and was caused by chart animations not completing before screenshots were taken.

Solution

Disable chart animations when running in e2e test environment by:

  • Adding useIsTestEnv hook to detect when tests are running
  • Passing isAnimationActive: !isTestEnv to useRechartsAnimation hook
  • This ensures charts render immediately without animation in tests, making screenshots consistent

Changes

  • Modified CashFlowGraph.tsx to check for test environment and disable animations accordingly
  • Animations are still enabled in production/normal usage

Testing

The e2e test should now be stable and consistently pass without timing issues.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6208 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 11/19/2025 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/fix-cash-flow-chart-animation-e2e` --- ### 📝 Commits (5) - [`a88ae3c`](https://github.com/actualbudget/actual/commit/a88ae3c9735425a8498dcae061ddd5f798732960) Fix flaky cash flow chart e2e test by disabling animations in test environment - [`c6ae299`](https://github.com/actualbudget/actual/commit/c6ae29967747701f9dbe5ad2dac86c7b2be0fe70) Add release notes for stabilization of VRT tests related to cashflow report - [`d4a8bf1`](https://github.com/actualbudget/actual/commit/d4a8bf1d092f73e13621e15f52a1ee330264f491) Update VRT screenshots - [`4f730fd`](https://github.com/actualbudget/actual/commit/4f730fd20ffe61a602ae6f68f821c95766f0eb6d) Run CI - [`8b9fade`](https://github.com/actualbudget/actual/commit/8b9fade1907dac3d4c1214225be9b1d820ccf172) Remove unused isTestEnv hook and related animation logic ### 📊 Changes **2 files changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png` (+0 -0) ➕ `upcoming-release-notes/6208.md` (+6 -0) </details> ### 📄 Description ## Problem The cash flow graph e2e test was flaky, with bar chart heights sometimes appearing at 10px and sometimes smaller. This only occurred in light mode and was caused by chart animations not completing before screenshots were taken. ## Solution Disable chart animations when running in e2e test environment by: - Adding `useIsTestEnv` hook to detect when tests are running - Passing `isAnimationActive: !isTestEnv` to `useRechartsAnimation` hook - This ensures charts render immediately without animation in tests, making screenshots consistent ## Changes - Modified `CashFlowGraph.tsx` to check for test environment and disable animations accordingly - Animations are still enabled in production/normal usage ## Testing The e2e test should now be stable and consistently pass without timing issues. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-01 02:53:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#55690