How can you test for focus in an AngularJS directive? I would expect the following to work:
describe(\'focus test\', function(){ it(\'should focus element\',
In Jasmine 2, this is now:
beforeEach(function() { jasmine.addMatchers({ toHaveFocus: function() { return { compare: function(actual) { return { pass: document.activeElement === actual[0] }; } }; } }); });