Add first directive spec

This commit is contained in:
Kevin Gisi
2015-06-08 08:35:10 -04:00
parent 7b2164e0db
commit f95eaa736a

View File

@@ -0,0 +1,26 @@
'use strict';
describe('focusMe Directive', function() {
var element, scope;
beforeEach(module('habitrpg'));
beforeEach(inject(function($rootScope, $compile) {
scope = $rootScope.$new();
element = "<input focus-me='model'></input>";
element = $compile(element)(scope);
scope.$digest();
}));
it('focuses the element when appended to the DOM', function(done) {
inject(function($timeout) {
element.appendTo(document.body);
element.on('focus', function() { done() });
$timeout.flush();
});
});
});