Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi committed Apr 21, 2017
1 parent 2597036 commit b21052e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/iron-overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@

test('node with autofocus is focused', function(done) {
runAfterOpen(overlay, function() {
assert.isTrue(overlay.contentHost.contains(getDeepActiveElement()),
const autofocused = overlay.contentHost.querySelector('[autofocus]');
assert.equal(getDeepActiveElement(), autofocused,
'<button autofocus> is focused');
done();
});
Expand All @@ -446,23 +447,22 @@
test('no-auto-focus will not focus node with autofocus', function(done) {
overlay.noAutoFocus = true;
runAfterOpen(overlay, function() {
assert.isFalse(overlay.contentHost.contains(getDeepActiveElement()),
const autofocused = overlay.contentHost.querySelector('[autofocus]');
assert.notEqual(getDeepActiveElement(), autofocused,
'<button autofocus> not focused after opened');
done();
});
// In Safari the element with autofocus will immediately receive focus when displayed for the first time http://jsbin.com/woroci/2/ Ensure this is not the case for overlay.
assert.isFalse(overlay.contentHost.contains(getDeepActiveElement()),
const autofocused = overlay.contentHost.querySelector('[autofocus]');
assert.notEqual(getDeepActiveElement(), autofocused,
'<button autofocus> not immediately focused');
});

suite('restore focus', function() {
let buttons;
setup(function(done) {
setup(function() {
buttons = fixture('buttons');
buttons[0].focus();
// setTimeout(function() {
done();
// });
});

test('restores focus to previous focusable', function(done) {
Expand Down

0 comments on commit b21052e

Please sign in to comment.