angular.module('myApp').directive(errorDirective, function(){
return {
link: function(scope, element, attributes){
element.bind('change paste keyup', function(){
var value= $(this).val();
if(value < 100)
$('#inputerror').removeClass('dispnone').addClass('dispblock');
else if(value >100 && value <500)
$('#inputerror').removeClass('disp').addClass('dblock');
else
$('#inputerror').removeClass('dnone').addClass('displayblock');
});
}
}
});
in my html file
<input id= 'inputvalue' ng-model="inputvalue" errorDirective/>
<span id= 'inputerror' class="errorNone"><span>Error occurs </span></span>
How to write the unit test case for the given directive ??