I have the following directive to autofocus a field:
.directive(\'ngAutofocus\', function ($timeout) {
return {
restrict: \'A\',
link: fu
I figured it out, and it was pretty obvious actually;
it('should set the focus on timeout', function () {
spyOn(elm[0],'focus');
$timeout.flush();
expect(elm[0].focus).toHaveBeenCalled();
})
My problem was two-fold: