Skip to content

Commit

Permalink
test(interactivity-checker): remove unncessary setTimeout (#2159)
Browse files Browse the repository at this point in the history
  • Loading branch information
belev authored and jelbourn committed Dec 14, 2016
1 parent b3e21b8 commit 9e3c59c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/lib/core/a11y/interactivity-checker.spec.ts
@@ -1,6 +1,5 @@
import {InteractivityChecker} from './interactivity-checker';
import {MdPlatform} from '../platform/platform';
import {async} from '@angular/core/testing';

describe('InteractivityChecker', () => {
let testContainerElement: HTMLElement;
Expand Down Expand Up @@ -337,22 +336,15 @@ describe('InteractivityChecker', () => {
expect(checker.isTabbable(button)).toBe(true);
});

it('should mark elements which are contentEditable as tabbable', async(() => {
it('should mark elements which are contentEditable as tabbable', () => {
let editableEl = createFromTemplate('<div contenteditable="true">', true);

// Wait one tick, because the browser takes some time to update the tabIndex
// according to the contentEditable attribute.
setTimeout(() => {
expect(checker.isTabbable(editableEl)).toBe(true);

expect(checker.isTabbable(editableEl)).toBe(true);
editableEl.tabIndex = -1;

editableEl.tabIndex = -1;

expect(checker.isTabbable(editableEl)).toBe(false);

}, 0);

}));
expect(checker.isTabbable(editableEl)).toBe(false);
});

it('should never mark iframe elements as tabbable', () => {
let iframe = createFromTemplate('<iframe>', true);
Expand Down

0 comments on commit 9e3c59c

Please sign in to comment.