From: Krinkle Date: Wed, 13 Jul 2011 23:57:11 +0000 (+0000) Subject: Fixes for jquery.localize unit test IE6,IE7,IE8: X-Git-Tag: 1.31.0-rc.0~28852 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=21361dabeef38262ce65ec9e2e7346d3b6c53a37;p=lhc%2Fweb%2Fwiklou.git Fixes for jquery.localize unit test IE6,IE7,IE8: - localize doesn't offically support "self" modification, only for children via find(). Which is why most were wrapped in a
(otherwise find('[title-msg]') won't find it). Now adding a
around the others as well to be consistent, and hopefully fix the breakage on testswarm in IE6-8 --- diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.js b/tests/qunit/suites/resources/jquery/jquery.localize.js index 52ae4672ca..43eac092b6 100644 --- a/tests/qunit/suites/resources/jquery/jquery.localize.js +++ b/tests/qunit/suites/resources/jquery/jquery.localize.js @@ -12,16 +12,16 @@ test( 'Handle basic replacements', function() { mw.messages.set( 'basic', 'Basic stuff' ); // Tag: html:msg - html = ''; - $lc = $( html ).localize(); + html = '
'; + $lc = $( html ).localize().find( 'span' ); - strictEqual( $lc.html(), 'Basic stuff', 'Tag: html:msg' ); + strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' ); // Tag: msg (deprecated) - html = ''; - $lc = $( html ).localize(); + html = '
'; + $lc = $( html ).localize().find( 'span' ); - strictEqual( $lc.html(), 'Basic stuff', 'Tag: msg' ); + strictEqual( $lc.text(), 'Basic stuff', 'Tag: msg' ); // Attribute: title-msg html = '
'; @@ -46,8 +46,8 @@ test( 'Proper escaping', function() { // making sure it is actually using text() and attr() (or something with the same effect) // Text escaping - html = ''; - $lc = $( html ).localize(); + html = '
'; + $lc = $( html ).localize().find( 'span' ); strictEqual( $lc.text(), mw.msg( 'properfoo' ), 'Content is inserted as text, not as html.' ); @@ -95,12 +95,12 @@ test( 'Options', function() { strictEqual( $lc.text(), 'The Bars', 'Variable keys mapping - text' ); // Passing parameteters to mw.msg - html = ''; + html = '
'; $lc = $( html ).localize( { params: { 'foo-welcome': [sitename, 'yesterday'] } - } ); + } ).find( 'span' ); strictEqual( $lc.text(), 'Welcome to Wikipedia! (last visit: yesterday)', 'Passing parameteters to mw.msg' );