Skip to content

Update Legend alignment VR test#7554

Merged
PavelVanecek merged 1 commit into
mainfrom
legendvs-addaxes
Jul 14, 2026
Merged

Update Legend alignment VR test#7554
PavelVanecek merged 1 commit into
mainfrom
legendvs-addaxes

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

VR test only, no other changes

Summary by CodeRabbit

  • Tests
    • Expanded visual coverage for chart legends across horizontal and vertical alignment combinations.
    • Added coverage for legend offsets, including rendering with a 20-pixel offset.
    • Updated test charts with explicit axes, named series, and clearer color and border styling.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The Legend alignment VR fixture now renders explicit axes, named lines, distinct colors, and direct alignment props. Screenshot coverage is split into default alignment and offset={20} cases.

Changes

Legend alignment visual regression

Layer / File(s) Summary
Update legend alignment fixture
test-vr/tests/LegendPositionComponents.tsx
The fixture adds XAxis and YAxis, names the lines, changes their colors, and renders Legend alignment through wrapperStyle, align, verticalAlign, and offset props.
Expand screenshot assertions
test-vr/tests/LegendPosition.spec-vr.tsx
The single screenshot test is replaced with separate default and offset={20} tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • recharts/recharts#6975: Added the VR Legend alignment test setup and related rendering assertions in the same test files.

Suggested reviewers: ckifer

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far too brief and omits the required template sections like issue, motivation, testing, and checklist. Expand the PR description to follow the template: add the issue link, motivation, testing details, change type, screenshots if needed, and checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: updating the Legend alignment VR test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch legendvs-addaxes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test-vr/tests/LegendPosition.spec-vr.tsx (1)

10-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix minor grammar in the code comment.

For polish and readability, you can add the missing article "an" before "svg attribute" and capitalize "SVG".

💅 Proposed nitpick fix
 test('Legend.align with offset', async ({ mount }) => {
   /*
-   * offset doesn't actually do anything because it's svg attribute, but Legend renders as HTML.
+   * offset doesn't actually do anything because it's an SVG attribute, but Legend renders as HTML.
    * Test included for completeness anyway
    */
   const component = await mount(<LegendAlignVRTest offset={20} />);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test-vr/tests/LegendPosition.spec-vr.tsx` around lines 10 - 17, Update the
comment in the Legend.align offset test to add “an” before “SVG attribute” and
capitalize “SVG,” without changing the test behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test-vr/tests/LegendPosition.spec-vr.tsx`:
- Around line 10-17: Update the comment in the Legend.align offset test to add
“an” before “SVG attribute” and capitalize “SVG,” without changing the test
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 16e65712-af58-4028-81be-c1f075813eb5

📥 Commits

Reviewing files that changed from the base of the PR and between 1552fe0 and 6df062c.

⛔ Files ignored due to path filters (9)
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-1-webkit-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-webkit-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-without-offset-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-without-offset-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-without-offset-1-webkit-linux.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • test-vr/tests/LegendPosition.spec-vr.tsx
  • test-vr/tests/LegendPositionComponents.tsx

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@chromatic-com

chromatic-com Bot commented Jul 14, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 198 tests unchanged
🟢 UI Review: 198 stories published -- no changes
Storybook icon Storybook Publish: 198 stories published

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.19%. Comparing base (9e8fa4f) to head (6df062c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7554   +/-   ##
=======================================
  Coverage   88.19%   88.19%           
=======================================
  Files         615      615           
  Lines       14270    14270           
  Branches     3588     3588           
=======================================
  Hits        12586    12586           
  Misses       1494     1494           
  Partials      190      190           

☔ View full report in Codecov by Harness.
📢 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.

@github-actions

Copy link
Copy Markdown
Contributor

@PavelVanecek
PavelVanecek merged commit 3c8f313 into main Jul 14, 2026
65 checks passed
@PavelVanecek
PavelVanecek deleted the legendvs-addaxes branch July 14, 2026 20:49
This was referenced Jul 15, 2026
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