ember-native-dom-helpers
ember-native-dom-helpers copied to clipboard
click doesn't trigger <a {{action}}>
I have a template:
<a {{action 'delete'}} data-test={{hook 'delete' id=thing.id}}>
and a test
import { click } from 'ember-native-dom-helpers'
...
await click(hook('delete', { id: thing.id }))
With that, the action never fires. If I change the template to
<a onclick={{action 'delete'}} data-test={{hook 'delete' id=thing.id}}>
everything works as expected.
If this is expected behavior, it would be nice to have it in the README. If it's unexpected, I may be able to create a reproduction to help solve it.
What kind of test? Acceptance?
Acceptance?
Yes. More fully,
moduleForAcceptance('Acceptance | Delete Thing', {
})
test('deleting things', async function (assert) {
// create a thing
await visit('/things')
await click(hook('delete', { id: thing.id }))
assert.hasNoElement($hook('thing', { name: thing.name }))
})
In moduleForAcceptance tests ember-native-dom-helpers defers to window.click which comes from Ember's own ember-testing package (and therefore this addon's code itself isn't actually being used for clicking).
What Ember version?
@rwjblue I don't think that is right. In ember-native-dom-helpers the global window.click is never used, no matter what.
What Ember version?
2.16.0-beta.2