From 5327b16ee6dec259205827dd2d9e791deebfc5b7 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Fri, 13 May 2011 12:43:49 +0000 Subject: [PATCH] comparing colors cross-browser is Aweful. Turns out Opera normalizes to hexidecimal.. Using anoter property instead (margin-top). Thanks TestSwarm --- resources/test/unit/mediawiki.util/mediawiki.util.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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.' ); }); -- 2.20.1