From 4506956a8d76f632e0f874dcbb7a7b78e3c38b45 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Mon, 4 Jul 2011 20:11:55 +0000 Subject: [PATCH] mediawiki.util.test.js: TestSwarm reports breakage in Chrome4-Linux - It only appears on Linux not in Mac OS X with the same Chrome version - Adding extra checks and stops() in attempt to get a more useful report than then sudden stop at: http://toolserver.org/~krinkle/testswarm/?state=runresults&run_id=1258&client_id=3092# --- .../suites/resources/mediawiki/mediawiki.util.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.js index f88b33e5ad..67fce22831 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.js @@ -55,7 +55,7 @@ test( 'addCSS', function() { equal( typeof style, 'object', 'addCSS returned an object' ); strictEqual( style.disabled, false, 'property "disabled" is available and set to false' ); - equal( $testEl.css('visibility'), 'hidden', 'Added style properties are in effect' ); + equal( $testEl.css( 'visibility' ), 'hidden', 'Added style properties are in effect' ); // Clean up $( style.ownerNode ) @@ -64,20 +64,22 @@ test( 'addCSS', function() { }); test( 'toggleToc', function() { - expect(3); + expect(4); strictEqual( mw.util.toggleToc(), null, 'Return null if there is no table of contents on the page.' ); - var tocHtml = + var tocHtml = '
' + '
' + '

Contents

' + ' [Hide ]' + '
' + '
' + - '
'; - var $toc = $(tocHtml).appendTo( 'body' ); - var $toggleLink = $( '#togglelink' ); + '', + $toc = $(tocHtml).appendTo( 'body' ), + $toggleLink = $( '#togglelink' ); + + strictEqual( $toggleLink.length, 1, 'Toggle link is appended to the page.' ); // Toggle animation is asynchronous // QUnit should not finish this test() untill they are all done @@ -90,6 +92,7 @@ test( 'toggleToc', function() { $toc.remove(); }; var actionB = function() { + start(); stop(); strictEqual( mw.util.toggleToc( $toggleLink, actionC ), true, 'Return boolean true if the TOC is now visible.' ); }; var actionA = function() { -- 2.20.1