Skip to content

Add Area animation tests #5967

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

Merged
merged 3 commits into from
Jun 20, 2025
Merged

Add Area animation tests #5967

merged 3 commits into from
Jun 20, 2025

Conversation

PavelVanecek
Copy link
Collaborator

Related Issue

#5914

@PavelVanecek PavelVanecek requested a review from Copilot June 19, 2025 13:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds tests and utilities for area chart animations and integrates manual animation controls in Storybook.

  • Introduces a shared expectAreaCurve helper for validating SVG path d attributes.
  • Refactors AreaChart.spec.tsx to use the new helper and updates the expectDots signature for immutability.
  • Enhances animation testing by adding isAnimating to the mock manager and wrapping Storybook examples with ManualAnimations.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/helpers/expectAreaCurve.ts New helper to assert area curve d attributes in tests
test/helper/expectDots.ts Updated expectDots to accept ReadonlyArray<ExpectedDot>
test/chart/AreaChart.spec.ts[x] Refactored to import expectAreaCurve and reordered imports
test/animation/MockAbstractAnimationManager.ts Added isAnimating() method to mock animation manager
storybook/storybook-addon-recharts/ManualAnimations.tsx Added inline styling to wrapper div for ResponsiveContainer
storybook/stories/Examples/AreaChart.stories.tsx Wrapped story example in ManualAnimations for animation control
Comments suppressed due to low confidence (2)

test/helper/expectDots.ts:1

  • [nitpick] The tests use both test/helper and test/helpers directories, which can be confusing. Consider unifying the folder name (singular or plural) for consistency.
export type ExpectedDot = {

test/animation/MockAbstractAnimationManager.ts:54

  • The new isAnimating method isn't covered by any unit tests. Adding a test case for scenarios when the queue is empty vs. non-empty will help ensure its correctness.
  public isAnimating(): boolean {

Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.23%. Comparing base (f93cf6d) to head (e396740).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5967      +/-   ##
==========================================
+ Coverage   96.07%   96.23%   +0.16%     
==========================================
  Files         194      194              
  Lines       19623    19623              
  Branches     4012     4020       +8     
==========================================
+ Hits        18853    18885      +32     
+ Misses        764      732      -32     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ckifer ckifer merged commit d553150 into main Jun 20, 2025
20 checks passed
@ckifer ckifer deleted the area-animation-test branch June 20, 2025 06:22
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.

2 participants