mediawiki.util.test.js: TestSwarm reports breakage in Chrome4-Linux
authorKrinkle <krinkle@users.mediawiki.org>
Mon, 4 Jul 2011 20:11:55 +0000 (20:11 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Mon, 4 Jul 2011 20:11:55 +0000 (20:11 +0000)
- 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#

tests/qunit/suites/resources/mediawiki/mediawiki.util.js

index f88b33e..67fce22 100644 (file)
@@ -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 =
        '<table id="toc" class="toc"><tr><td>' +
                '<div id="toctitle">' +
                        '<h2>Contents</h2>' +
                        '<span class="toctoggle">&nbsp;[<a href="#" class="internal" id="togglelink">Hide</a>&nbsp;]</span>' +
                '</div>' +
                '<ul><li></li></ul>' +
-       '</td></tr></table>';
-       var $toc = $(tocHtml).appendTo( 'body' );
-       var $toggleLink = $( '#togglelink' );
+       '</td></tr></table>',
+               $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() {