Skip to content

test: release mouse before hover and focus captures - #2553

Merged
amir-ba merged 1 commit into
mainfrom
fix/visual-mouse-release
Oct 7, 2026
Merged

amir-ba merged 1 commit into
mainfrom
fix/visual-mouse-release

Conversation

@amir-ba

@amir-ba amir-ba commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the remaining mouse-state capture issue from #2552 in the textarea and textfield visual tests. Release the mouse immediately after the active screenshot, before hover and focus captures.

 mouse.down()
 screenshot(active)
+mouse.up()
 screenshot(hover)
 screenshot(focus)

This PR is independent of the data-grid readiness fix. No component code or visual baselines change.

Evidence

  • Before: Both tests leave the mouse button pressed through hover and focus captures.
  • After: Both tests release it immediately after active.png.
  • Pinned Linux Chromium visual comparison: all 38 textarea/textfield cases pass in light/dark mode with snapshot updates disabled, using freshly prepared Storybook assets.
  • Existing visual baselines are unchanged.
  • Changed-file Prettier and whitespace checks pass.

Merge Danger

Door: two-way

Blast Radius: tests

Only two visual test sequences change. Production behavior is unchanged.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:20
@amir-ba
amir-ba requested a review from maomaoZH as a code owner October 7, 2026 15:20

Copilot AI 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.

🟢 Approval recommended

The focused test-only changes correctly prevent pressed mouse state from leaking into later captures.

0 open findings

What changed in this PR

Releases the mouse after active-state captures so hover and focus screenshots use the correct input state.

Changes:

  • Add page.mouse.up() after textarea and textfield active screenshots.
  • Leave production code and visual baselines unchanged.
File Description
packages/​visual-tests/​src/​textfield.visual.spec.js Releases the mouse before subsequent state captures.
packages/​visual-tests/​src/​textarea.visual.spec.js Releases the mouse before subsequent state captures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@amir-ba
amir-ba merged commit 576554b into main Oct 7, 2026
12 checks passed
@amir-ba
amir-ba deleted the fix/visual-mouse-release branch October 7, 2026 15:32
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