Skip to content

CodeRabbit Generated Unit Tests: Add 71 unit tests for zIndex and utilities#6538

Merged
ckifer merged 10 commits intomainfrom
coderabbitai/utg/70a7bc9
Nov 6, 2025
Merged

CodeRabbit Generated Unit Tests: Add 71 unit tests for zIndex and utilities#6538
ckifer merged 10 commits intomainfrom
coderabbitai/utg/70a7bc9

Conversation

@coderabbitai
Copy link
Contributor

@coderabbitai coderabbitai bot commented Oct 30, 2025

Unit test generation was requested by @PavelVanecek.

The following files were modified:

  • TEST_SUMMARY.md
  • test/cartesian/Bar.spec.tsx
  • test/polar/RadialBar.spec.tsx
  • test/state/selectors/pieSelectors.spec.tsx
  • test/util/BarBackgroundZIndex.spec.ts
  • test/zindex/DefaultZIndexes.spec.ts

@coderabbitai
Copy link
Contributor Author

coderabbitai bot commented Oct 30, 2025

Important

Review skipped

CodeRabbit bot authored PR detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Base automatically changed from stacked-bar-background to main October 30, 2025 19:18
TEST_SUMMARY.md Outdated
@@ -0,0 +1,181 @@
# Unit Test Summary for Branch: stacked-bar-background
Copy link
Member

Choose a reason for hiding this comment

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

this is nice and all but why...?

});
});

describe('Bar background zIndex', () => {
Copy link
Member

Choose a reason for hiding this comment

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

tests are pretty silly and aren't asserting anything useful. They need to be asserting the order things are rendered in the DOM and that these are behind the actual bars. Not that they exist

))(state => selectPieDataWithAnimation(state, 0, 'pie', false, undefined, dataWithMultipleProps, cells));

const result = spy.mock.lastCall?.[0];
expect(result).toBeDefined();
Copy link
Member

Choose a reason for hiding this comment

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

not asserting anything useful

))(state => selectPieDataWithAnimation(state, 0, 'pie', false, undefined, mixedData, cells));

const result = spy.mock.lastCall?.[0];
expect(result).toBeDefined();
Copy link
Member

Choose a reason for hiding this comment

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

same

});

// Helper function mimicking getZIndex from Bar.tsx
function getZIndexHelper(background: any): number {
Copy link
Member

Choose a reason for hiding this comment

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

errrr ?

Maybe this needs recreated? Its testing the test helper

import { DefaultZIndexes } from '../../src/zindex/DefaultZIndexes';

describe('DefaultZIndexes', () => {
describe('structure and values', () => {
Copy link
Member

Choose a reason for hiding this comment

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

this is dumb. 100 does equal 100, thank you AI

});
});

describe('value types', () => {
Copy link
Member

Choose a reason for hiding this comment

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

typescript can tell us this

@PavelVanecek
Copy link
Collaborator

/update-snapshots

@github-actions
Copy link
Contributor

ℹ️ No snapshot updates needed. All visual regression snapshots are up to date.

@PavelVanecek PavelVanecek force-pushed the coderabbitai/utg/70a7bc9 branch from 69a06e2 to 10fc4bd Compare November 6, 2025 15:02
@PavelVanecek
Copy link
Collaborator

I think I fixed @ckifer

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.18%. Comparing base (2526335) to head (10fc4bd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6538      +/-   ##
==========================================
+ Coverage   91.17%   91.18%   +0.01%     
==========================================
  Files         491      492       +1     
  Lines       41001    40999       -2     
  Branches     4582     4584       +2     
==========================================
+ Hits        37381    37384       +3     
+ Misses       3603     3598       -5     
  Partials       17       17              

☔ 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.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Bundle Report

Changes will increase total bundle size by 231 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.12MB 240 bytes (0.02%) ⬆️
recharts/bundle-es6 965.05kB 34 bytes (0.0%) ⬆️
recharts/bundle-umd 508.17kB -43 bytes (-0.01%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
cartesian/Bar.js -90 bytes 26.46kB -0.34%
polar/RadialBar.js -142 bytes 20.45kB -0.69%
zIndex/ZIndexLayer.js (New) 3.35kB 3.35kB 100.0% 🚀
zIndex/ZIndexPortal.js (New) 2.67kB 2.67kB 100.0% 🚀
zIndex/DefaultZIndexes.js (New) 2.37kB 2.37kB 100.0% 🚀
zIndex/zIndexSelectors.js (New) 1.5kB 1.5kB 100.0% 🚀
zIndex/getZIndexFromUnknown.js (New) 472 bytes 472 bytes 100.0% 🚀
zindex/ZIndexLayer.js (Deleted) -3.35kB 0 bytes -100.0% 🗑️
zindex/ZIndexPortal.js (Deleted) -2.67kB 0 bytes -100.0% 🗑️
zindex/DefaultZIndexes.js (Deleted) -2.37kB 0 bytes -100.0% 🗑️
zindex/zIndexSelectors.js (Deleted) -1.5kB 0 bytes -100.0% 🗑️
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js -43 bytes 508.17kB -0.01%
view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
cartesian/Bar.js -117 bytes 24.84kB -0.47%
polar/RadialBar.js -169 bytes 19.05kB -0.88%
zIndex/ZIndexLayer.js (New) 3.14kB 3.14kB 100.0% 🚀
zIndex/DefaultZIndexes.js (New) 2.23kB 2.23kB 100.0% 🚀
zIndex/ZIndexPortal.js (New) 1.87kB 1.87kB 100.0% 🚀
zIndex/zIndexSelectors.js (New) 1.24kB 1.24kB 100.0% 🚀
zIndex/getZIndexFromUnknown.js (New) 320 bytes 320 bytes 100.0% 🚀
zindex/ZIndexLayer.js (Deleted) -3.14kB 0 bytes -100.0% 🗑️
zindex/DefaultZIndexes.js (Deleted) -2.23kB 0 bytes -100.0% 🗑️
zindex/ZIndexPortal.js (Deleted) -1.87kB 0 bytes -100.0% 🗑️
zindex/zIndexSelectors.js (Deleted) -1.24kB 0 bytes -100.0% 🗑️

Copy link
Member

@ckifer ckifer left a comment

Choose a reason for hiding this comment

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

Much better

<Bar background isAnimationActive={false} dataKey="value" />
</BarChart>,
);
debug();
Copy link
Member

Choose a reason for hiding this comment

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

Debug

@ckifer ckifer merged commit 9dd5431 into main Nov 6, 2025
28 checks passed
@PavelVanecek PavelVanecek deleted the coderabbitai/utg/70a7bc9 branch November 6, 2025 23:45
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