Skip to content

Conversation

@TatuLund
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts how TestBenchElement#click() triggers click events so that Flow click listeners receive the correct click count, and adds an integration test view plus tests to verify single and double click behavior and focus.

Changes:

  • Update TestBenchElement.click() to dispatch a custom MouseEvent('click') with an explicit detail value instead of calling the element’s click method via callFunction("click").
  • Introduce a ButtonView test route that exposes a native button with single-click, double-click, and focus listeners reflecting click count and focus state in the DOM.
  • Add ButtonIT integration tests to validate single-click and double-click behavior (including click count and focus) via NativeButtonElement.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/TestBenchElement.java Changes click() to use an inline JavaScript text block that dispatches a MouseEvent('click', { detail: 1, ... }) on the element, preserving focus and existing fallback behavior.
vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/ButtonIT.java Adds JUnit integration tests that exercise NativeButtonElement.click() and .doubleClick() and assert correct click count and focus side effects.
vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/ButtonView.java Adds a Flow @Route view with a native button wired with single-click, double-click, and focus listeners that update spans used by the new tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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