I create a component my-input-component.hbs:
<input type="checkbox"
checked={{checked}}
disabled={{disabled}}>
and I add a integration test:
import { click, find } from 'ember-native-dom-helpers';
//...
test('disabled state', async function(assert) {
await render(hbs`{{my-input-component disabled=true checked=false}}`);
assert.notOk(find('input[type="checkbox"]').checked);
await click('input[type="checkbox"]');
assert.notOk(find('input[type="checkbox"]').checked);
});
The second assert.notOk fails, find('input[type="checkbox"]').checked returns true.
If I replace click helper by something like that, it's working:
Ember.run(() => document.querySelector('input[type="checkbox"]').click());
Do you have any idea about why click has this behaviour? Thanks.
I create a component
my-input-component.hbs:and I add a integration test:
The second
assert.notOkfails,find('input[type="checkbox"]').checkedreturns true.If I replace
clickhelper by something like that, it's working:Do you have any idea about why
clickhas this behaviour? Thanks.