mediawiki.jqueryMsg.test.js: Additional test cases for external link
authorFomafix <fomafix@googlemail.com>
Mon, 16 Jun 2014 06:05:46 +0000 (06:05 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Mon, 16 Jun 2014 06:05:46 +0000 (06:05 +0000)
Change-Id: I9755121fbd341b7768608bd1db8809c394321913

tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js

index bc4b253..afa57ee 100644 (file)
        } );
 
 // Tests that {{-transformation vs. general parsing are done as requested
-       QUnit.test( 'Curly brace transformation', 14, function ( assert ) {
+       QUnit.test( 'Curly brace transformation', 16, function ( assert ) {
                var oldUserLang = mw.config.get( 'wgUserLanguage' );
 
                assertBothModes( assert, ['gender-msg', 'Bob', 'male'], 'Bob: blue', 'gender is resolved' );
                        'Foo <a href="http://example.com">bar</a>',
                        'External link message processed when format is \'parse\''
                );
+               assert.htmlEqual(
+                       formatParse( 'external-link-replace', $( '<i>' ) ),
+                       'Foo <i>bar</i>',
+                       'External link message processed as jQuery object when format is \'parse\''
+               );
+               assert.htmlEqual(
+                       formatParse( 'external-link-replace', function () {} ),
+                       'Foo <a href="#">bar</a>',
+                       'External link message processed as function when format is \'parse\''
+               );
 
                mw.config.set( 'wgUserLanguage', oldUserLang );
        } );