mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Adjust formatting
This commit is contained in:
@@ -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;
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user