* upgrade patches for oracle 1.17->1.19
[mediawiki.git] / tests / qunit / suites / resources / jquery / jquery.tabIndex.js
blobb320d6381723eeb52102a9a4d945b0a616e286a9
1 module( 'jquery.tabIndex.js' );
3 test( '-- Initial check', function(){
4         expect(2);
6         ok( $.fn.firstTabIndex, '$.fn.firstTabIndex defined' );
7         ok( $.fn.lastTabIndex, '$.fn.lastTabIndex defined' );
9 });
11 test( 'firstTabIndex', function(){
12         expect(2);
14         var testEnvironment = 
15 '<form>' +
16         '<input tabindex="7" />' +
17         '<input tabindex="9" />' +
18         '<textarea tabindex="2">Foobar</textarea>' +
19         '<textarea tabindex="5">Foobar</textarea>' +
20 '</form>';
21         var $testA = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
23         deepEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
25         var $testB = $( '<div />' );
27         deepEqual( $testB.firstTabIndex(), null, 'Return null if none available.' );
29         // Clean up
30         $testA.add( $testB).remove();
31 });
33 test( 'lastTabIndex', function(){
34         expect(2);
36         var testEnvironment = 
37 '<form>' +
38         '<input tabindex="7" />' +
39         '<input tabindex="9" />' +
40         '<textarea tabindex="2">Foobar</textarea>' +
41         '<textarea tabindex="5">Foobar</textarea>' +
42 '</form>';
43         var $testA = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
45         deepEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
47         var $testB = $( '<div />' );
49         deepEqual( $testB.lastTabIndex(), null, 'Return null if none available.' );
51         // Clean up
52         $testA.add( $testB).remove();
53 });