Skip to content

Commit

Permalink
fix(event-objects): add missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed May 7, 2019
1 parent fc11c2a commit 9edad7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion projects/spectator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@netbasal/spectator",
"description": "Angular tests made easy",
"author": "Netanel Basal <[email protected]>",
"version": "3.7.1",
"version": "3.7.2",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
4 changes: 4 additions & 0 deletions projects/spectator/src/lib/event-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export function createMouseEvent(type: string, x = 0, y = 0, button = 0) {

event.initMouseEvent(type, true /* canBubble */, false /* cancelable */, window /* view */, 0 /* detail */, x /* screenX */, y /* screenY */, x /* clientX */, y /* clientY */, false /* ctrlKey */, false /* altKey */, false /* shiftKey */, false /* metaKey */, button /* button */, null /* relatedTarget */);

// `initMouseEvent` doesn't allow us to pass the `buttons` and
// defaults it to 0 which looks like a fake event.
Object.defineProperty(event, 'buttons', { get: () => 1 });

return event;
}

Expand Down

0 comments on commit 9edad7d

Please sign in to comment.