From 91e194556c52d2f354344f930419eef2dd6267f0 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 4 Sep 2013 05:51:59 +0200 Subject: Update to MediaWiki 1.21.2 --- .../resources/jquery/jquery.tabIndex.test.js | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js (limited to 'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js') 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 = '
' + + '' + + '' + + '' + + '' + + '
'; + + $testA = $( '
' ).html( html ).appendTo( '#qunit-fixture' ); + assert.strictEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' ); + + $testB = $( '
' ); + assert.strictEqual( $testB.firstTabIndex(), null, 'Return null if none available.' ); + } ); + + QUnit.test( 'lastTabIndex', 2, function ( assert ) { + var html, $testA, $testB; + html = '
' + + '' + + '' + + '' + + '' + + '
'; + + $testA = $( '
' ).html( html ).appendTo( '#qunit-fixture' ); + assert.strictEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' ); + + $testB = $( '
' ); + assert.strictEqual( $testB.lastTabIndex(), null, 'Return null if none available.' ); + } ); +}( jQuery ) ); -- cgit v1.2.3-54-g00ecf