diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-03-28 05:41:12 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-03-28 05:41:12 +0100 |
commit | 9441dde8bfb95277df073717ed7817dced40f948 (patch) | |
tree | ba31c10147e91bda378b77c8cae90c5651af9bfe /tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js | |
parent | d417de70fcf39e0a7a15ba780b597914d16ca0f7 (diff) |
Update to MediaWiki 1.22.5
Diffstat (limited to 'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js')
-rw-r--r-- | tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js b/tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js new file mode 100644 index 00000000..12137931 --- /dev/null +++ b/tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js @@ -0,0 +1,35 @@ +( function ( $ ) { + QUnit.module( 'jquery.tabIndex', QUnit.newMwEnvironment() ); + + QUnit.test( 'firstTabIndex', 2, function ( assert ) { + var html, $testA, $testB; + html = '<form>' + + '<input tabindex="7" />' + + '<input tabindex="9" />' + + '<textarea tabindex="2">Foobar</textarea>' + + '<textarea tabindex="5">Foobar</textarea>' + + '</form>'; + + $testA = $( '<div>' ).html( html ).appendTo( '#qunit-fixture' ); + assert.strictEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' ); + + $testB = $( '<div>' ); + assert.strictEqual( $testB.firstTabIndex(), null, 'Return null if none available.' ); + } ); + + QUnit.test( 'lastTabIndex', 2, function ( assert ) { + var html, $testA, $testB; + html = '<form>' + + '<input tabindex="7" />' + + '<input tabindex="9" />' + + '<textarea tabindex="2">Foobar</textarea>' + + '<textarea tabindex="5">Foobar</textarea>' + + '</form>'; + + $testA = $( '<div>' ).html( html ).appendTo( '#qunit-fixture' ); + assert.strictEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' ); + + $testB = $( '<div>' ); + assert.strictEqual( $testB.lastTabIndex(), null, 'Return null if none available.' ); + } ); +}( jQuery ) ); |