Skip to content

Commit 23d4eb5

Browse files
committed
Core tests: Split .focus() test into two tests to avoid bug in IE with stop() and start().
1 parent d8c6c32 commit 23d4eb5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tests/unit/core/core.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55

66
module('core - jQuery extensions');
77

8-
test('focus', function() {
9-
expect(3);
8+
test('focus - original functionality', function() {
9+
expect(1);
1010

11-
var el = $('#inputTabindex0'),
12-
// used to remove focus from the main element
13-
other = $('#inputTabindex10');
14-
15-
// test original functionality
16-
el.focus(function() {
17-
ok(true, 'event triggered');
18-
});
19-
el.focus();
20-
other.focus();
21-
22-
// trigger event handler + callback
23-
stop();
24-
el.focus(500, function() {
25-
ok(true, 'callback triggered');
26-
start();
27-
});
28-
other.focus();
11+
$('#inputTabindex0')
12+
.focus(function() {
13+
ok(true, 'event triggered');
14+
})
15+
.focus();
16+
});
17+
18+
asyncTest('focus', function() {
19+
expect(2);
20+
$('#inputTabindex0')
21+
.focus(function() {
22+
ok(true, 'event triggered');
23+
})
24+
.focus(500, function() {
25+
ok(true, 'callback triggered');
26+
$(this).unbind('focus');
27+
start();
28+
});
2929
});
3030

3131
test('zIndex', function() {

0 commit comments

Comments
 (0)