{"action":"created","comment":{"url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/comments/156904996","pull_request_review_id":83455897,"id":156904996,"diff_hunk":"@@ -0,0 +1,54 @@\n+import { merge } from '@ember/polyfills';\n+import getElement from './-get-element';\n+import triggerEvent from './trigger-event';\n+import { KEYBOARD_EVENT_TYPES } from './fire-event';\n+\n+const DEFAULT_MODIFIERS = Object.freeze({\n+  ctrlKey: false,\n+  altKey: false,\n+  shiftKey: false,\n+  metaKey: false,\n+});\n+\n+/**\n+  @public\n+  @param {String|HTMLElement} target\n+  @param {'keydown' | 'keyup' | 'keypress'} eventType\n+  @param {String} keyCode\n+  @param {Object} modifiers\n+  @param {Boolean} modifiers.ctrlKey\n+  @param {Boolean} modifiers.altKey\n+  @param {Boolean} modifiers.shiftKey\n+  @param {Boolean} modifiers.metaKey\n+  @return {Promise<void>}\n+*/\n+export default function triggerKeyEvent(target, eventType, keyCode, modifiers = DEFAULT_MODIFIERS) {\n+  if (!target) {\n+    throw new Error('Must pass an element or selector to `triggerKeyEvent`.');\n+  }\n+\n+  let element = getElement(target);\n+  if (!element) {\n+    throw new Error(`Element not found when calling \\`triggerKeyEvent('${target}', ...)\\`.`);\n+  }\n+\n+  if (!eventType) {\n+    throw new Error(`Must provide an \\`eventType\\` to \\`triggerKeyEvent\\``);\n+  }\n+\n+  if (KEYBOARD_EVENT_TYPES.indexOf(eventType) === -1) {\n+    throw new Error(\n+      `Must provide an \\`eventType\\` of ${KEYBOARD_EVENT_TYPES.join(\n+        ', '\n+      )} to \\`triggerKeyEvent\\` but you passed \\`${eventType}\\`.`","path":"addon-test-support/@ember/test-helpers/dom/trigger-key-event.js","position":43,"original_position":43,"commit_id":"526e81ccccdd10eaf0dfd0eab2638fa8677e74af","original_commit_id":"e790075e8d2f9a2ac78d21fc5ce9bcda097af582","user":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars2.githubusercontent.com/u/141300?v=4","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"body":"can we fix this by extracting `KEYBOARD_EVENT_TYPES.join(', ')` into a variable?","created_at":"2017-12-14T10:25:42Z","updated_at":"2017-12-14T10:33:17Z","html_url":"https://github.com/emberjs/ember-test-helpers/pull/258#discussion_r156904996","pull_request_url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/comments/156904996"},"html":{"href":"https://github.com/emberjs/ember-test-helpers/pull/258#discussion_r156904996"},"pull_request":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258"}},"in_reply_to_id":155654350},"pull_request":{"url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258","id":156632086,"html_url":"https://github.com/emberjs/ember-test-helpers/pull/258","diff_url":"https://github.com/emberjs/ember-test-helpers/pull/258.diff","patch_url":"https://github.com/emberjs/ember-test-helpers/pull/258.patch","issue_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/258","number":258,"state":"open","locked":false,"title":"Bring over DOM helper implementation.","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars0.githubusercontent.com/u/12637?v=4","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"body":"TODO:\r\n\r\n- [x] Add all the helpers in the RFC\r\n  - [x] `click`\r\n  - [x] `tap`\r\n  - [x] `triggerKeyEvent`\r\n  - [x] `triggerEvent`\r\n  - [x] `fillIn`\r\n  - [x] `focus`\r\n  - [x] `blur`\r\n  - [x] `waitUntil`\r\n  - [x] `waitFor`\r\n- [x] Add unit tests for DOM Helpers\r\n  - [x] `click`\r\n  - [x] `tap`\r\n  - [x] `triggerKeyEvent`\r\n  - [x] `triggerEvent`\r\n  - [x] `fillIn`\r\n  - [x] `focus`\r\n  - [x] `blur`\r\n  - [x] `waitUntil`\r\n  - [x] `waitFor`\r\n- [x] Fix tests when running with jQuery (current CI builds without jQuery are passing, but jQuery builds are failing)...\r\n- [x] Account for https://github.com/cibernox/ember-native-dom-helpers/pull/104","created_at":"2017-12-06T03:25:52Z","updated_at":"2017-12-14T10:33:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a8d11141d5cc500cf565456c9ad130beb37dc3b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258/commits","review_comments_url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258/comments","review_comment_url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/258/comments","statuses_url":"https://api.github.com/repos/emberjs/ember-test-helpers/statuses/526e81ccccdd10eaf0dfd0eab2638fa8677e74af","head":{"label":"rwjblue:dom-helpers","ref":"dom-helpers","sha":"526e81ccccdd10eaf0dfd0eab2638fa8677e74af","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars0.githubusercontent.com/u/12637?v=4","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"repo":{"id":30099678,"name":"ember-test-helpers","full_name":"rwjblue/ember-test-helpers","owner":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars0.githubusercontent.com/u/12637?v=4","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwjblue/ember-test-helpers","description":"Test-framework-agnostic helpers for testing Ember.js applications","fork":true,"url":"https://api.github.com/repos/rwjblue/ember-test-helpers","forks_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/forks","keys_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/teams","hooks_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/hooks","issue_events_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/events","assignees_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/tags","blobs_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/languages","stargazers_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/stargazers","contributors_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/contributors","subscribers_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/subscribers","subscription_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/subscription","commits_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/merges","archive_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/downloads","issues_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/labels{/name}","releases_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/rwjblue/ember-test-helpers/deployments","created_at":"2015-01-31T02:33:12Z","updated_at":"2016-10-24T19:32:12Z","pushed_at":"2017-12-14T04:38:25Z","git_url":"git://github.com/rwjblue/ember-test-helpers.git","ssh_url":"git@github.com:rwjblue/ember-test-helpers.git","clone_url":"https://github.com/rwjblue/ember-test-helpers.git","svn_url":"https://github.com/rwjblue/ember-test-helpers","homepage":"","size":833,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"emberjs:master","ref":"master","sha":"99804eaa7325331bcbacc9087185cd365141379e","user":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars2.githubusercontent.com/u/1253363?v=4","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"repo":{"id":19406251,"name":"ember-test-helpers","full_name":"emberjs/ember-test-helpers","owner":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars2.githubusercontent.com/u/1253363?v=4","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emberjs/ember-test-helpers","description":"Test-framework-agnostic helpers for testing Ember.js applications","fork":false,"url":"https://api.github.com/repos/emberjs/ember-test-helpers","forks_url":"https://api.github.com/repos/emberjs/ember-test-helpers/forks","keys_url":"https://api.github.com/repos/emberjs/ember-test-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emberjs/ember-test-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emberjs/ember-test-helpers/teams","hooks_url":"https://api.github.com/repos/emberjs/ember-test-helpers/hooks","issue_events_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/emberjs/ember-test-helpers/events","assignees_url":"https://api.github.com/repos/emberjs/ember-test-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/emberjs/ember-test-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/emberjs/ember-test-helpers/tags","blobs_url":"https://api.github.com/repos/emberjs/ember-test-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emberjs/ember-test-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emberjs/ember-test-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/emberjs/ember-test-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emberjs/ember-test-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/emberjs/ember-test-helpers/languages","stargazers_url":"https://api.github.com/repos/emberjs/ember-test-helpers/stargazers","contributors_url":"https://api.github.com/repos/emberjs/ember-test-helpers/contributors","subscribers_url":"https://api.github.com/repos/emberjs/ember-test-helpers/subscribers","subscription_url":"https://api.github.com/repos/emberjs/ember-test-helpers/subscription","commits_url":"https://api.github.com/repos/emberjs/ember-test-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/emberjs/ember-test-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/emberjs/ember-test-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/emberjs/ember-test-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/emberjs/ember-test-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emberjs/ember-test-helpers/merges","archive_url":"https://api.github.com/repos/emberjs/ember-test-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emberjs/ember-test-helpers/downloads","issues_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/emberjs/ember-test-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/emberjs/ember-test-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emberjs/ember-test-helpers/labels{/name}","releases_url":"https://api.github.com/repos/emberjs/ember-test-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/emberjs/ember-test-helpers/deployments","created_at":"2014-05-03T15:44:27Z","updated_at":"2017-11-26T17:04:58Z","pushed_at":"2017-12-14T09:03:23Z","git_url":"git://github.com/emberjs/ember-test-helpers.git","ssh_url":"git@github.com:emberjs/ember-test-helpers.git","clone_url":"https://github.com/emberjs/ember-test-helpers.git","svn_url":"https://github.com/emberjs/ember-test-helpers","homepage":"","size":770,"stargazers_count":67,"watchers_count":67,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":68,"open_issues":6,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258"},"html":{"href":"https://github.com/emberjs/ember-test-helpers/pull/258"},"issue":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/258"},"comments":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/258/comments"},"review_comments":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258/comments"},"review_comment":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/pulls/258/commits"},"statuses":{"href":"https://api.github.com/repos/emberjs/ember-test-helpers/statuses/526e81ccccdd10eaf0dfd0eab2638fa8677e74af"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Turbo87"}}