Skip to content

Allow firing shortcut on components #1748

@mcollovati

Description

@mcollovati

In the UI Unit Test base class, there's the fireShortcut method that can be used to simulate a keyboard shortcut performed on the browser.
However, the method is meant to work with shortcuts attached to the UI (or the current modal component) created with the Shortcuts API, and it does not work with key down listener attached to a component through the KeyNotifier interface methods.

To trigger this kind of listeners, it would be good to add a similar fireShortcut() method on the base tester class (ComponentTester).
The implementation should just use ShortcutsKt._fireShortcut() providing the encapsulated component, after checking the component usability.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🅿️Parking lot

Status

Maybe

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions