r107800 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107799‎ | r107800 | r107801 >
Date:06:47, 2 January 2012
Author:santhosh
Status:ok
Tags:
Comment:
Add qunit test for mediawiki.jqueryMsg.js- Initial version.
Modified paths:
  • /trunk/phase3/tests/qunit/index.html (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js (added) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/index.html
@@ -70,6 +70,8 @@
7171 <script src="../../resources/jquery/jquery.tablesorter.js"></script>
7272 <script src="../../resources/jquery/jquery.textSelection.js"></script>
7373 <script src="../../resources/mediawiki/mediawiki.Title.js"></script>
 74+ <script src="../../resources/mediawiki.language/mediawiki.language.js"></script>
 75+ <script src="../../resources/mediawiki/mediawiki.jqueryMsg.js"></script>
7476 <script src="../../resources/mediawiki.special/mediawiki.special.js"></script>
7577 <script src="../../resources/mediawiki.special/mediawiki.special.recentchanges.js"></script>
7678
@@ -100,6 +102,7 @@
101103 <script src="suites/resources/jquery/jquery.tablesorter.test.js" charset="UTF-8"></script>
102104 <script src="suites/resources/jquery/jquery.textSelection.test.js" charset="UTF-8"></script>
103105 <script src="suites/resources/mediawiki/mediawiki.Title.test.js"></script>
 106+ <script src="suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script>
104107 <script src="suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script>
105108 </head>
106109 <body>
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
@@ -0,0 +1,17 @@
 2+module( 'mediawiki.jqueryMsg' );
 3+
 4+test( '-- Initial check', function() {
 5+ expect( 1 );
 6+ ok( mw.jqueryMsg, 'mw.jqueryMsg defined' );
 7+} );
 8+
 9+test( 'mw.jqueryMsg Plural', function() {
 10+ expect( 5 );
 11+ var parser = mw.jqueryMsg.getMessageFunction();
 12+ ok( parser, 'Parser Function initialized' );
 13+ ok( mw.messages.set( 'plural-msg', 'Found $1 {{PLURAL:$1|item|items}}' ), 'mw.messages.set: Register' );
 14+ equal( parser('plural-msg', 0 ) , 'Found 0 items', 'Plural test for english with zero as count' );
 15+ equal( parser('plural-msg', 1 ) , 'Found 1 item', 'Singular test for english' );
 16+ equal( parser('plural-msg', 2 ) , 'Found 2 items', 'Plural test for english' );
 17+} );
 18+
Property changes on: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
___________________________________________________________________
Added: svn:eol-style
119 + native

Status & tagging log