Skip to content

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Sep 29, 2025

Implements a Clickable mixin interface that provides click functionality to all component testers via ComponentTester base class.

Changes:

  • Add Clickable interface with default implementations for click(), middleClick(), and rightClick() methods
  • ComponentTester now implements Clickable, making click methods available to all testers
  • Remove duplicate click implementations from ButtonTester, HtmlClickContainer, and NativeDetailsTester
  • Add navigate() method to AnchorTester and RouterLinkTester that returns the navigated view
  • Override click() in navigation testers to call navigate() internally (returns void for interface compliance) (BREAKING CHANGE: existing code relying on the click return type needs to migrate to navigate)
  • Add comprehensive tests for the new click functionality
  • Update existing tests to use navigate() when return value is needed

The solution allows all component testers to have consistent click functionality while preserving special behaviors for components that need custom handling (Checkbox, RadioButton, SideNav).

Implements a Clickable mixin interface that provides click functionality to all component testers via ComponentTester base class.

Changes:
- Add Clickable interface with default implementations for click(), middleClick(), and rightClick() methods
- ComponentTester now implements Clickable, making click methods available to all testers
- Remove duplicate click implementations from ButtonTester, HtmlClickContainer, and NativeDetailsTester
- Add navigate() method to AnchorTester and RouterLinkTester that returns the navigated view
- Override click() in navigation testers to call navigate() internally (returns void for interface compliance)
- Add comprehensive tests for the new click functionality
- Update existing tests to use navigate() when return value is needed

The solution allows all component testers to have consistent click functionality while preserving special behaviors for components that need custom handling (Checkbox, RadioButton, SideNav).

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@Artur- Artur- requested a review from mcollovati September 29, 2025 07:25
Copy link
Contributor

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

ClickHandler is a public interface, so we cannot remove it because it might have been used in user projects.
We need to restore and deprecate, suggesting the usage of Clickable instead.

Artur- and others added 3 commits October 1, 2025 09:30
Updated testClick_customComponent to use getEventBus().addListener()
instead of element.addEventListener() for more reliable event handling
that works with ComponentUtil.fireEvent().

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed type inference issue in testClick_customComponent by using raw
ComponentEventListener type with @SuppressWarnings annotation. The
generic type inference was causing compilation failures in CI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Artur- and others added 3 commits October 1, 2025 11:45
Replaced getEventBus().addListener() with ComponentUtil.addListener()
for a cleaner implementation in testClick_customComponent. This is the
recommended approach and avoids the need for @SuppressWarnings.

Note: Explicit cast to ComponentEventListener is still required due to
Java's type inference limitations with lambda expressions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mcollovati mcollovati changed the title feat: Add generic click() method to all component testers (#1940) feat!: Add generic click() method to all component testers (#1940) Oct 1, 2025
@mcollovati mcollovati merged commit 764cedd into main Oct 1, 2025
5 checks passed
@mcollovati mcollovati deleted the generic-click branch October 1, 2025 11:10
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