From 21361dabeef38262ce65ec9e2e7346d3b6c53a37 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Wed, 13 Jul 2011 23:57:11 +0000 Subject: [PATCH] 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 --- .../resources/jquery/jquery.localize.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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' ); -- 2.20.1