mercredi 5 août 2015

jasmine error - Expected event [object Object] to have been triggered

When I try try to check if a 'click' event is correctly attached, I get this error:

Expected event [object Object] to have been triggered on #div .div.

myModule.init() // attach the events to the elements
var clickEvent = spyOnEvent('#div .span', 'click');
$('#div .span').click();
expect('click').toHaveBeenTriggeredOn('#div .span');
expect(clickEvent).toHaveBeenTriggered();

p.s. Everything that I found about that didn't solve the problem. p.p.s. I load the HTML by jasmine.getFixtures().load(..)

Aucun commentaire:

Enregistrer un commentaire