mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
Refactor focus-me spec to use an assertion
This commit is contained in:
parent
8171209ab1
commit
9cc4993fb3
1 changed files with 5 additions and 3 deletions
|
|
@ -14,13 +14,15 @@ describe('focusMe Directive', function() {
|
|||
scope.$digest();
|
||||
}));
|
||||
|
||||
it('focuses the element when appended to the DOM', function(done) {
|
||||
it('focuses the element when appended to the DOM', function() {
|
||||
inject(function($timeout) {
|
||||
element.appendTo(document.body);
|
||||
var focusSpy = sinon.spy();
|
||||
|
||||
element.on('focus', function() { done() });
|
||||
element.appendTo(document.body);
|
||||
element.on('focus', focusSpy);
|
||||
|
||||
$timeout.flush();
|
||||
expect(focusSpy).to.have.been.called;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue