Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions addon-test-support/@ember/test-helpers/dom/trigger-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ registerHook('triggerEvent', 'start', (target: Target, eventType: string) => {
* }
* }
* )
*
*
* @example
* <caption>
* Using `triggerEvent` to simulate a mouseleave event
*
* `triggerEvent` provides a way to to trigger any [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)
* The `options` param can contain any sub set of properties from each of the Event sub-types.
* If supplied, the `options.relatedTarget` has to be an HTML `Element`.
* </caption>
*
* const target = find('#zone')
* triggerEvent(
* target,
* 'mouseleave',
* { relatedTarget: target }
* )
*/
export default function triggerEvent(
target: Target,
Expand Down