diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /tests/qunit/suites/resources/jquery/jquery.tabIndex.js | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'tests/qunit/suites/resources/jquery/jquery.tabIndex.js')
-rw-r--r-- | tests/qunit/suites/resources/jquery/jquery.tabIndex.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/qunit/suites/resources/jquery/jquery.tabIndex.js b/tests/qunit/suites/resources/jquery/jquery.tabIndex.js new file mode 100644 index 00000000..1ff81e58 --- /dev/null +++ b/tests/qunit/suites/resources/jquery/jquery.tabIndex.js @@ -0,0 +1,50 @@ +module( 'jquery.tabIndex.js' ); + +test( '-- Initial check', function() { + expect(2); + + ok( $.fn.firstTabIndex, '$.fn.firstTabIndex defined' ); + ok( $.fn.lastTabIndex, '$.fn.lastTabIndex defined' ); +}); + +test( 'firstTabIndex', function() { + expect(2); + + var testEnvironment = +'<form>' + + '<input tabindex="7" />' + + '<input tabindex="9" />' + + '<textarea tabindex="2">Foobar</textarea>' + + '<textarea tabindex="5">Foobar</textarea>' + +'</form>'; + + var $testA = $( '<div>' ).html( testEnvironment ).appendTo( 'body' ); + strictEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' ); + + var $testB = $( '<div>' ); + strictEqual( $testB.firstTabIndex(), null, 'Return null if none available.' ); + + // Clean up + $testA.add( $testB ).remove(); +}); + +test( 'lastTabIndex', function() { + expect(2); + + var testEnvironment = +'<form>' + + '<input tabindex="7" />' + + '<input tabindex="9" />' + + '<textarea tabindex="2">Foobar</textarea>' + + '<textarea tabindex="5">Foobar</textarea>' + +'</form>'; + + var $testA = $( '<div>' ).html( testEnvironment ).appendTo( 'body' ); + strictEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' ); + + var $testB = $( '<div>' ); + strictEqual( $testB.lastTabIndex(), null, 'Return null if none available.' ); + + // Clean up + $testA.add( $testB ).remove(); +}); |