I have file app.js:
var container = $('.feed'),
feedList = $('.feed-list');
...
feedList.on('click', 'a', function() {
var item = $(this);
$('body').addClass('menu-hidden');
loadFeed(item.data('id'));
return false;}
...
I've tried to sure about click events and that menu is hidden. And my spec is:
it('Checking toggle on menu through spies function', function() {
feedList = $('.feed-list');
spyOn(feedList, 'on');
feedList.trigger('click');
expect(feedList.On).toHaveBeenCalled();
});
So...test is fail. It complain something about feedList object... "not defined".
I hope to your help.
Thanks a lot.
Aucun commentaire:
Enregistrer un commentaire