I'm trying to understand how the directives works and how to test the directives with jasmine. I cant test link function in directive. What I am doing wrong?
it('should add class', function(){
//digest the $rootScope
$scope.$digest();
expect(element.hasClass('test')).toBe(true);
});
});
I am trying to write a test that ensures that the element has an added class. http://ift.tt/1S2m4pl
I'm receiving error element.addClass it not a function.
Aucun commentaire:
Enregistrer un commentaire