http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88622
Revision: 88622
Author: krinkle
Date: 2011-05-22 23:36:17 +0000 (Sun, 22 May 2011)
Log Message:
-----------
Adding test suite for jquery.tabIndex.js, currently broken per:
(bug 29048) jQuery.tabIndex: firstTabIndex() outputs the same as lastTabIndex()
Modified Paths:
--------------
trunk/phase3/tests/qunit/index.html
Added Paths:
-----------
trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
Modified: trunk/phase3/tests/qunit/index.html
===================================================================
--- trunk/phase3/tests/qunit/index.html 2011-05-22 23:34:19 UTC (rev 88621)
+++ trunk/phase3/tests/qunit/index.html 2011-05-22 23:36:17 UTC (rev 88622)
@@ -33,8 +33,9 @@
</script>
<!-- MW: Non-default modules -->
+ <script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
<script src="../../resources/jquery/jquery.colorUtil.js"></script>
- <script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
+ <script src="../../resources/jquery/jquery.tabIndex.js"></script>
<!-- QUnit: Load framework -->
<link rel="stylesheet" href="../../resources/jquery/jquery.qunit.css" />
@@ -45,8 +46,8 @@
<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.
Added: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
===================================================================
--- trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
(rev 0)
+++ trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
2011-05-22 23:36:17 UTC (rev 88622)
@@ -0,0 +1,40 @@
+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
Property changes on:
trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
___________________________________________________________________
Added: svn:eol-style
+ native
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs