Skip to content

test: fix context-menu overlay tests to pass with base styles - #9557

Merged
web-padawan merged 1 commit into
mainfrom
test/context-menu-base-styles-fix
Jun 26, 2025
Merged

web-padawan merged 1 commit into
mainfrom
test/context-menu-base-styles-fix

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Similar to #9554

Base styles added 1px border to [part='overlay'] and that breaks some tests. Updated to take border into account.

Type of change

  • Test

@sonarqubecloud

Copy link
Copy Markdown

const rootItemRect = getMenuItems(rootMenu)[0].getBoundingClientRect();
const element = document.elementFromPoint(rootItemRect.left, rootItemRect.top);
const border = parseInt(getComputedStyle(rootOverlay.$.overlay).borderWidth);
const element = document.elementFromPoint(rootItemRect.left + border, rootItemRect.top + border);

@web-padawan web-padawan Jun 26, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For some reason elementFromPoint returned <html> in this test - it ignores vaadin-context-menu-overlay due to pointer-events: none, and doesn't return vaadin-context-menu-list-box unless I add border.

@web-padawan
web-padawan merged commit 97185a6 into main Jun 26, 2025
@web-padawan
web-padawan deleted the test/context-menu-base-styles-fix branch June 26, 2025 10:41
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