Merge pull request #55 from prokls/prokls/activeElement
Check focus using document.activeElement
This commit is contained in:
commit
4378cdb6fd
1 changed files with 8 additions and 2 deletions
|
@ -169,7 +169,10 @@ describe('Sprite', function() {
|
|||
expect($('.ask-container').css('bottom')).toBe('7px');
|
||||
expect($('.ask-container').css('height')).toBe('25px');
|
||||
expect($('.ask-container').css('height')).toBe('25px');
|
||||
expect($('.ask-text-field').is(':focus')).toBe(true);
|
||||
expect(
|
||||
$('.ask-text-field').is(':focus') ||
|
||||
document.activeElement.className.match(/ask-text-field/) !== null
|
||||
).toBe(true);
|
||||
expect(spriteProto.askInputOn).toBe(true);
|
||||
});
|
||||
|
||||
|
@ -177,7 +180,10 @@ describe('Sprite', function() {
|
|||
spriteProto.visible = false;
|
||||
spriteProto.showAsk();
|
||||
expect($('.ask-container').css('display')).toBe('none');
|
||||
expect($('.ask-text-field').is(':focus')).toBe(false);
|
||||
expect(
|
||||
$('.ask-text-field').is(':focus') ||
|
||||
document.activeElement.className.match(/ask-text-field/) !== null
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue