{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/365","repository_url":"https://api.github.com/repos/emberjs/ember-test-helpers","labels_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/365/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/365/comments","events_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/365/events","html_url":"https://github.com/emberjs/ember-test-helpers/issues/365","id":316319612,"number":365,"title":"click is working a little differently than native-dom-helpers","user":{"login":"kellyselden","id":602423,"avatar_url":"https://avatars1.githubusercontent.com/u/602423?v=4","gravatar_id":"","url":"https://api.github.com/users/kellyselden","html_url":"https://github.com/kellyselden","followers_url":"https://api.github.com/users/kellyselden/followers","following_url":"https://api.github.com/users/kellyselden/following{/other_user}","gists_url":"https://api.github.com/users/kellyselden/gists{/gist_id}","starred_url":"https://api.github.com/users/kellyselden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellyselden/subscriptions","organizations_url":"https://api.github.com/users/kellyselden/orgs","repos_url":"https://api.github.com/users/kellyselden/repos","events_url":"https://api.github.com/users/kellyselden/events{/privacy}","received_events_url":"https://api.github.com/users/kellyselden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-20T15:47:58Z","updated_at":"2018-04-20T15:52:39Z","closed_at":null,"author_association":"NONE","body":"The following code works as expected with ember-native-dom-helpers:\r\n\r\n```js\r\n    let promise = click('[data-test-confirm-delete-modal-button]');\r\n\r\n    assert.ok(find('[data-test-deleting-modal]'));\r\n\r\n    deferred.resolve();\r\n\r\n    await promise;\r\n\r\n    assert.notOk(find('[data-test-deleting-modal]'));\r\n```\r\n\r\nWhen switching over to the new helpers, `click` never actually clicks anything until the `await promise;` line, so the `data-test-deleting-modal` shows and hides instantaneously and the first assert fails.\r\n\r\nReplacing `assert.ok(find('[data-test-deleting-modal]'));` with `await waitFor('[data-test-deleting-modal]');` makes it now work with the new helpers.\r\n\r\nSo the new code becomes:\r\n\r\n```js\r\n    let promise = click('[data-test-confirm-delete-modal-button]');\r\n\r\n    await waitFor('[data-test-deleting-modal]');\r\n\r\n    deferred.resolve();\r\n\r\n    await promise;\r\n\r\n    assert.notOk(find('[data-test-deleting-modal]'));\r\n```\r\n\r\nMy question is, is this an unintended bug, or a known think you have to do to use the new helpers?"},"comment":{"url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/comments/383140137","html_url":"https://github.com/emberjs/ember-test-helpers/issues/365#issuecomment-383140137","issue_url":"https://api.github.com/repos/emberjs/ember-test-helpers/issues/365","id":383140137,"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},"created_at":"2018-04-20T15:52:39Z","updated_at":"2018-04-20T15:52:39Z","author_association":"MEMBER","body":"> a known think you have to do to use the new helpers\r\n\r\n☝️ \r\n\r\nyou were relying on the fact that `click()` used to cause a synchronous render, but that is actually not a real guarantee. the helpers in this repo will always run async to enforce that these things are tested correctly."}}
{"actor":{"display_login":"Turbo87"}}