I'm writing some ember integration tests, and I'm running into some problems with testing everything on my component. For instance, I have a component that looks like
// my-component.js
export default Ember.Component.extend({
click() {
console.log('here');
}
});
And the test that looks like this
// my-component-test.js
describeComponent(
'my-component',
'Integration: MyComponentComponent',
{
integration: true
},
function() {
describe('interacting', function() {
beforeEach(function() {
this.render(hbs`
{{my-component}}
`);
});
it('registers the click', function() {
this.$().click();
});
});
}
);
In the actual case I obviously want to test what the component is doing on that click, but unfortunately this trigger doesn't work (Not getting the log). Anyone have an answer as to how to trigger the click event on the root element?
Aucun commentaire:
Enregistrer un commentaire