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

Closed
opened 2026-02-28 21:27:34 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6208

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6208 **State:** closed **Merged:** Yes --- ## 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.
GiteaMirror added the pull-request label 2026-02-28 21:27:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6386