-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0d8448
commit 250204d
Showing
11 changed files
with
44 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
import { | ||
createFakeEvent, | ||
createKeyboardEvent, | ||
createMouseEvent, | ||
createTransitionEndEvent | ||
createMouseEvent | ||
} from './event-objects'; | ||
|
||
/** Shorthand to dispatch a fake event on a specified node. */ | ||
export function dispatchFakeEvent(node: Node, eventName: string) { | ||
node.dispatchEvent(createFakeEvent(eventName)); | ||
export function dispatchFakeEvent(node: Node, type: string) { | ||
node.dispatchEvent(createFakeEvent(type)); | ||
} | ||
|
||
/** Shorthand to dispatch a keyboard event with a specified key code. */ | ||
export function dispatchKeyboardEvent(node: Node, keyCode: number, type = 'keydown') { | ||
export function dispatchKeyboardEvent(node: Node, type: string, keyCode: number) { | ||
node.dispatchEvent(createKeyboardEvent(type, keyCode)); | ||
} | ||
|
||
/** Shorthand to dispatch a mouse event on the specified coordinates. */ | ||
export function dispatchMouseEvent(node: Node, type: string, x = 0, y = 0) { | ||
node.dispatchEvent(createMouseEvent(type, x, y)); | ||
} | ||
|
||
/** Shorthand to dispatch a transition event with a specified property. */ | ||
export function dispatchTransitionEndEvent(node: Node, propertyName: string, elapsedTime = 0) { | ||
node.dispatchEvent(createTransitionEndEvent(propertyName, elapsedTime)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.