File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change 5
5
6
6
module ( 'core - jQuery extensions' ) ;
7
7
8
- test ( 'focus' , function ( ) {
9
- expect ( 3 ) ;
8
+ test ( 'focus - original functionality ' , function ( ) {
9
+ expect ( 1 ) ;
10
10
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
+ } ) ;
29
29
} ) ;
30
30
31
31
test ( 'zIndex' , function ( ) {
You can’t perform that action at this time.
0 commit comments