Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.util.js |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | equal( typeof style, 'object', 'addCSS returned an object' ); |
57 | 57 | strictEqual( style.disabled, false, 'property "disabled" is available and set to false' ); |
58 | 58 | |
59 | | - equal( $testEl.css('visibility'), 'hidden', 'Added style properties are in effect' ); |
| 59 | + equal( $testEl.css( 'visibility' ), 'hidden', 'Added style properties are in effect' ); |
60 | 60 | |
61 | 61 | // Clean up |
62 | 62 | $( style.ownerNode ) |
— | — | @@ -64,21 +64,23 @@ |
65 | 65 | }); |
66 | 66 | |
67 | 67 | test( 'toggleToc', function() { |
68 | | - expect(3); |
| 68 | + expect(4); |
69 | 69 | |
70 | 70 | strictEqual( mw.util.toggleToc(), null, 'Return null if there is no table of contents on the page.' ); |
71 | 71 | |
72 | | - var tocHtml = |
| 72 | + var tocHtml = |
73 | 73 | '<table id="toc" class="toc"><tr><td>' + |
74 | 74 | '<div id="toctitle">' + |
75 | 75 | '<h2>Contents</h2>' + |
76 | 76 | '<span class="toctoggle"> [<a href="#" class="internal" id="togglelink">Hide</a> ]</span>' + |
77 | 77 | '</div>' + |
78 | 78 | '<ul><li></li></ul>' + |
79 | | - '</td></tr></table>'; |
80 | | - var $toc = $(tocHtml).appendTo( 'body' ); |
81 | | - var $toggleLink = $( '#togglelink' ); |
| 79 | + '</td></tr></table>', |
| 80 | + $toc = $(tocHtml).appendTo( 'body' ), |
| 81 | + $toggleLink = $( '#togglelink' ); |
82 | 82 | |
| 83 | + strictEqual( $toggleLink.length, 1, 'Toggle link is appended to the page.' ); |
| 84 | + |
83 | 85 | // Toggle animation is asynchronous |
84 | 86 | // QUnit should not finish this test() untill they are all done |
85 | 87 | stop(); |
— | — | @@ -90,6 +92,7 @@ |
91 | 93 | $toc.remove(); |
92 | 94 | }; |
93 | 95 | var actionB = function() { |
| 96 | + start(); stop(); |
94 | 97 | strictEqual( mw.util.toggleToc( $toggleLink, actionC ), true, 'Return boolean true if the TOC is now visible.' ); |
95 | 98 | }; |
96 | 99 | var actionA = function() { |