Skip to content

test: use real mouse events in context-menu tooltip tests#11660

Merged
vursen merged 1 commit intomainfrom
test/real-mouse-context-menu-tooltip
May 6, 2026
Merged

test: use real mouse events in context-menu tooltip tests#11660
vursen merged 1 commit intomainfrom
test/real-mouse-context-menu-tooltip

Conversation

@vursen
Copy link
Copy Markdown
Contributor

@vursen vursen commented May 6, 2026

Simplify the context-menu tooltip integration test and bring it closer to real user interaction. The test relied on synthetic helpers — openMenu(target) (fires mouseover) and fire(_listBox, 'mouseleave') — plus extra plumbing around destructuring and requestContentUpdate() that did not reflect actual usage.

Changes

  • Open the menu via sendMouseToElement({ type: 'click', element: target }) with openOn = 'click', matching a real click.
  • Replace fire(_listBox, 'mouseleave') with sendMouse({ type: 'move', position: [0, 0] }) so the browser dispatches a real mouseleave.
  • Open the sub-menu via sendMouseToElement move on the parent item instead of openMenu(parent).
  • Drop redundant requestContentUpdate() + nextRender() — overlay is closed, items render on open.
  • Inline single-use getMenuItems(...) destructuring.

🤖 Generated with Claude Code

Replace synthetic event helpers with sendMouseToElement / sendMouse so
the integration test exercises the real contextmenu open path and the
real listbox mouseleave path instead of bypassing them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
14.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@vursen vursen requested a review from web-padawan May 6, 2026 12:11
@vursen vursen merged commit 81e3599 into main May 6, 2026
9 of 10 checks passed
@vursen vursen deleted the test/real-mouse-context-menu-tooltip branch May 6, 2026 12:14
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