</script>
<!-- MW: Non-default modules -->
- <script src="../../resources/jquery/jquery.colorUtil.js"></script>
<script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
+ <script src="../../resources/jquery/jquery.colorUtil.js"></script>
+ <script src="../../resources/jquery/jquery.tabIndex.js"></script>
<!-- QUnit: Load framework -->
<link rel="stylesheet" href="../../resources/jquery/jquery.qunit.css" />
<script src="suites/resources/mediawiki/mediawiki.user.js"></script>
<script src="suites/resources/jquery/jquery.mwPrototypes.js"></script>
<script src="suites/resources/mediawiki.util/mediawiki.util.js"></script>
- <script src="suites/resources/jquery/jquery.colorUtil.js"></script>
<script src="suites/resources/jquery/jquery.autoEllipsis.js"></script>
+ <script src="suites/resources/jquery/jquery.tabIndex.js"></script>
<!-- TestSwarm: If a test swarm is running this,
the following script will allow it to extract the results.
--- /dev/null
+module( 'jquery.tabIndex.js' );
+
+test( '-- Initial check', function(){
+
+ ok( $.fn.firstTabIndex, '$.fn.firstTabIndex defined' );
+ ok( $.fn.lastTabIndex, '$.fn.lastTabIndex defined' );
+
+});
+
+test( 'firstTabIndex', function(){
+
+ var testEnvironment =
+'<form>\
+ <input tabindex="7" />\
+ <input tabindex="2" />\
+ <textarea tabindex="9">Foobar</textarea>\
+</form>';
+ var $test = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
+
+ deepEqual( $test.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
+
+ // Clean up
+ $test.remove();
+});
+
+test( 'lastTabIndex', function(){
+
+ var testEnvironment =
+'<form>\
+ <input tabindex="7" />\
+ <input tabindex="2" />\
+ <textarea tabindex="9">Foobar</textarea>\
+</form>';
+ var $test = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
+
+ deepEqual( $test.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
+
+ // Clean up
+ $test.remove();
+});
\ No newline at end of file