i have following link function in angular directive definition object:
function link(scope, element) { var blurred = angular.element(element[0].getelementsbyclassname('blur')); blurred.on('click', function() { blurred.css({'-webkit-filter': 'none'}); }); } i'm attempting test '-webkit-filter': 'none' added style upon clicking 'blurred' element below test. problem both console.log's same; style expect have been added never is.
it('should add necessary style when clicked', function() { var blurred = angular.element(element[0].getelementsbyclassname('blur')); console.log(blurred); blurred.triggerhandler('click'); console.log(blurred); }); the logged value looks in both cases:
{0: <div class="blur ng-binding"> <br> <br> </div>, length: 1}
try add wait after click avoid race condition if
`waits(500);` // avoid race condition
Comments
Post a Comment