Add extra unit test in Transformation for mediawiki.Title
authorKrinkle <krinkle@users.mediawiki.org>
Sun, 18 Sep 2011 04:58:29 +0000 (04:58 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sun, 18 Sep 2011 04:58:29 +0000 (04:58 +0000)
* (bug 30843) mediawiki.Title should not convert extensions (anything after the last full stop) to lower case
* Patch my Michael M. slightly modified (moved to section "Transformation")
* Currently broken, will fix in next commit

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

index cda44a8..0edb127 100644 (file)
@@ -64,7 +64,7 @@ test( '-- Initial check', function() {
 });
 
 test( 'Transformation', function() {
-       expect(3);
+       expect(4);
        _titleConfig();
 
        var title;
@@ -75,6 +75,9 @@ test( 'Transformation', function() {
        title = new mw.Title( 'File:Glarg_foo_glang.jpg' );
        equal( title.getNameText(), 'Glarg foo glang' );
 
+       title = new mw.Title( 'User:ABC.DEF' );
+       equal( title.toText(), 'User:ABC.DEF' );
+
        title = new mw.Title( '   MediaWiki:  Foo   bar   .js   ' );
        // Don't ask why, it's the way the backend works. One space is kept of each set
        equal( title.getName(), 'Foo_bar_.js', "Merge multiple spaces to a single space." );