Adjust formatting

This commit is contained in:
Blade Barringer
2015-08-31 20:35:23 -05:00
parent f4ca8bb78d
commit 1d8b10dc99

View File

@@ -15,19 +15,16 @@ describe('focusElement Directive', function() {
scope.$digest(); scope.$digest();
})); }));
it('places focus on the element it is applied to when the expression it binds to evaluates to true', it('places focus on the element it is applied to when the expression it binds to evaluates to true', inject(function($timeout) {
inject(function($timeout) { var focusSpy = sandbox.spy();
var focusSpy = sandbox.spy();
elementToFocus.appendTo(document.body); elementToFocus.appendTo(document.body);
elementToFocus.on('focus', focusSpy); elementToFocus.on('focus', focusSpy);
scope.focusThisLink = true; scope.focusThisLink = true;
scope.$digest(); scope.$digest();
$timeout.flush();
expect(document.activeElement.dataset.focusElement).to.eql("focusThisLink");
expect(focusSpy).to.have.been.called;
})
);
$timeout.flush();
expect(document.activeElement.dataset.focusElement).to.eql("focusThisLink");
expect(focusSpy).to.have.been.called;
}));
}); });