r88622 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88621‎ | r88622 | r88623 >
Date:23:36, 22 May 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js (added) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/index.html
@@ -33,8 +33,9 @@
3434 </script>
3535
3636 <!-- MW: Non-default modules -->
 37+ <script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
3738 <script src="../../resources/jquery/jquery.colorUtil.js"></script>
38 - <script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
 39+ <script src="../../resources/jquery/jquery.tabIndex.js"></script>
3940
4041 <!-- QUnit: Load framework -->
4142 <link rel="stylesheet" href="../../resources/jquery/jquery.qunit.css" />
@@ -45,8 +46,8 @@
4647 <script src="suites/resources/mediawiki/mediawiki.user.js"></script>
4748 <script src="suites/resources/jquery/jquery.mwPrototypes.js"></script>
4849 <script src="suites/resources/mediawiki.util/mediawiki.util.js"></script>
49 - <script src="suites/resources/jquery/jquery.colorUtil.js"></script>
5050 <script src="suites/resources/jquery/jquery.autoEllipsis.js"></script>
 51+ <script src="suites/resources/jquery/jquery.tabIndex.js"></script>
5152
5253 <!-- TestSwarm: If a test swarm is running this,
5354 the following script will allow it to extract the results.
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
@@ -0,0 +1,40 @@
 2+module( 'jquery.tabIndex.js' );
 3+
 4+test( '-- Initial check', function(){
 5+
 6+ ok( $.fn.firstTabIndex, '$.fn.firstTabIndex defined' );
 7+ ok( $.fn.lastTabIndex, '$.fn.lastTabIndex defined' );
 8+
 9+});
 10+
 11+test( 'firstTabIndex', function(){
 12+
 13+ var testEnvironment =
 14+'<form>\
 15+ <input tabindex="7" />\
 16+ <input tabindex="2" />\
 17+ <textarea tabindex="9">Foobar</textarea>\
 18+</form>';
 19+ var $test = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
 20+
 21+ deepEqual( $test.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
 22+
 23+ // Clean up
 24+ $test.remove();
 25+});
 26+
 27+test( 'lastTabIndex', function(){
 28+
 29+ var testEnvironment =
 30+'<form>\
 31+ <input tabindex="7" />\
 32+ <input tabindex="2" />\
 33+ <textarea tabindex="9">Foobar</textarea>\
 34+</form>';
 35+ var $test = $( '<div />' ).html( testEnvironment ).appendTo( 'body' );
 36+
 37+ deepEqual( $test.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
 38+
 39+ // Clean up
 40+ $test.remove();
 41+});
\ No newline at end of file
Property changes on: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tabIndex.js
___________________________________________________________________
Added: svn:eol-style
142 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r88625jquery.tabIndex.js was broken, not it works (for the first time?)...krinkle23:52, 22 May 2011

Comments

#Comment by Hashar (talk | contribs)   08:17, 6 June 2011

Looks like you removed the colorUtil.js tests:

- <script src="suites/resources/jquery/jquery.colorUtil.js"></script>
#Comment by Krinkle (talk | contribs)   08:25, 6 June 2011

That was fixed last week in the follow-up r88625. Didn't mention it in the commit message, my bad.

Status & tagging log