From: Krinkle Date: Fri, 13 May 2011 12:43:49 +0000 (+0000) Subject: comparing colors cross-browser is Aweful. Turns out Opera normalizes to hexidecimal... X-Git-Tag: 1.31.0-rc.0~30256 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=5327b16ee6dec259205827dd2d9e791deebfc5b7;p=lhc%2Fweb%2Fwiklou.git comparing colors cross-browser is Aweful. Turns out Opera normalizes to hexidecimal.. Using anoter property instead (margin-top). Thanks TestSwarm --- diff --git a/resources/test/unit/mediawiki.util/mediawiki.util.js b/resources/test/unit/mediawiki.util/mediawiki.util.js index 2943369990..45979c3e58 100644 --- a/resources/test/unit/mediawiki.util/mediawiki.util.js +++ b/resources/test/unit/mediawiki.util/mediawiki.util.js @@ -20,13 +20,12 @@ test( 'wikiUrlencode', function(){ test( 'addCSS', function(){ - var a = mw.util.addCSS( '#bodyContent { background-color: rgb(170, 255, 170); }' ); + var a = mw.util.addCSS( '#bodyContent { margin-top: 5px; }' ); ok( a, 'function works' ); same( a.disabled, false, 'property "disabled" is available and set to false' ); var $b = $('#bodyContent'); - var match = $b.css('background-color').match(/rgb\(170,\s*255,\s*170\)/); - ok( match && match.length === 1, 'Style color matches.' ); + equals( $b.css('margin-top'), '5px', 'Added style properties are in effect.' ); });