{"action":"created","issue":{"url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/16","labels_url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/16/comments","events_url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/16/events","html_url":"https://github.com/pangratz/ember-cli-htmlbars-inline-precompile/issues/16","id":93758526,"number":16,"title":"Best way to test a focusout event","user":{"login":"chrisgame","id":766429,"avatar_url":"https://avatars.githubusercontent.com/u/766429?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisgame","html_url":"https://github.com/chrisgame","followers_url":"https://api.github.com/users/chrisgame/followers","following_url":"https://api.github.com/users/chrisgame/following{/other_user}","gists_url":"https://api.github.com/users/chrisgame/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisgame/subscriptions","organizations_url":"https://api.github.com/users/chrisgame/orgs","repos_url":"https://api.github.com/users/chrisgame/repos","events_url":"https://api.github.com/users/chrisgame/events{/privacy}","received_events_url":"https://api.github.com/users/chrisgame/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-08T10:37:13Z","updated_at":"2015-07-09T08:05:52Z","closed_at":null,"body":"Hi,\r\nI'm trying to test a simple text field component that fires an action on focus out. I was wanting to use the style you show in the second example in the readme (integration: true and this.render). How would you suggest i get focusout to fire on the component under test?"},"comment":{"url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/comments/119866334","html_url":"https://github.com/pangratz/ember-cli-htmlbars-inline-precompile/issues/16#issuecomment-119866334","issue_url":"https://api.github.com/repos/pangratz/ember-cli-htmlbars-inline-precompile/issues/16","id":119866334,"user":{"login":"chrisgame","id":766429,"avatar_url":"https://avatars.githubusercontent.com/u/766429?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisgame","html_url":"https://github.com/chrisgame","followers_url":"https://api.github.com/users/chrisgame/followers","following_url":"https://api.github.com/users/chrisgame/following{/other_user}","gists_url":"https://api.github.com/users/chrisgame/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisgame/subscriptions","organizations_url":"https://api.github.com/users/chrisgame/orgs","repos_url":"https://api.github.com/users/chrisgame/repos","events_url":"https://api.github.com/users/chrisgame/events{/privacy}","received_events_url":"https://api.github.com/users/chrisgame/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T08:05:52Z","updated_at":"2015-07-09T08:05:52Z","body":"component.js looks like this...\r\n```\r\nimport Ember from 'ember';\r\n\r\nexport default Ember.Component.extend({\r\n  // Params\r\n  title: '',\r\n  value: '',\r\n  onValueChange: null,\r\n\r\n  tagName: 'li',\r\n\r\n  focusOut() {\r\n    let value = this.$('textarea').val();\r\n\r\n    this.$('textarea').scrollTop(0);\r\n    this.sendAction('onValueChange', value);\r\n  }\r\n});\r\n```\r\ntemplate.hbs looks like...\r\n```\r\n<span>{{title}}</span>\r\n<div>\r\n  <textarea value=\"{{value}}\"/>\r\n</div>\r\n```\r\n\r\ntest looks like...\r\n```\r\nimport hbs from 'htmlbars-inline-precompile';\r\nimport { moduleForComponent, test } from 'frontend-cp/tests/helpers/qunit';\r\n\r\nlet textAreaFieldValue = 'Some other value';\r\n\r\nmoduleForComponent('comp-field/text-area', 'Integration | Component | comp field text area', {\r\n  integration: true,\r\n  setup() {\r\n    this.set('textAreaFieldValue', textAreaFieldValue);\r\n  }\r\n});\r\ntest('action is fired when focus is lost', function(assert) {\r\n  assert.expect(1);\r\n\r\n  this.render(hbs`{{comp-field/text\r\n    title='Some other field'\r\n    value=textAreaFieldValue\r\n    onValueChange='assertTextAreaFieldValueChanged'\r\n  }}<input class=\"other\" value=\"something to focus on\"/>`);\r\n\r\n  this.on('assertTextAreaFieldValueChanged', value => assert.deepEqual(value, 'Bob'));\r\n\r\n  let $textArea = this.$(value);\r\n\r\n  $textArea.val('Bob');\r\n\r\n  this.$('.other').val('dave');\r\n  this.$('.other').click();\r\n  this.$('li:first').focusout();\r\n  this.$('li:first').blur();\r\n  this.$('li:first').trigger('focusout');\r\n  this.$('li:first').trigger('blur');\r\n});\r\n```"}}