X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fqunit%2Fsuites%2Fresources%2Fmediawiki%2Fmediawiki.toc.test.js;h=8786993869a22a9b02392272d9ff11cb77fc6216;hb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;hp=297f0fdb6526ca12b0b7708f06433874060c31ec;hpb=c584722cc2e3d33edae58d46c2149063b3fc6d72;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js index 297f0fdb65..8786993869 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js @@ -7,21 +7,22 @@ } ) ); QUnit.asyncTest( 'toggleToc', function ( assert ) { - var tocHtml, $toggleLink, $tocList; + var tocHtml, $toc, $toggleLink, $tocList; - assert.strictEqual( $( '#toc' ).length, 0, 'There is no table of contents on the page at the beginning' ); + assert.strictEqual( $( '.toc' ).length, 0, 'There is no table of contents on the page at the beginning' ); tocHtml = '
' + - '
' + + '
' + '

Contents

' + '
' + '' + '
'; - $( tocHtml ).appendTo( '#qunit-fixture' ); + $toc = $( tocHtml ); + $( '#qunit-fixture' ).append( $toc ); mw.hook( 'wikipage.content' ).fire( $( '#qunit-fixture' ) ); - $tocList = $( '#toc ul:first' ); - $toggleLink = $( '#togglelink' ); + $tocList = $toc.find( 'ul:first' ); + $toggleLink = $toc.find( '.togglelink' ); assert.strictEqual( $toggleLink.length, 1, 'Toggle link is added to the table of contents' );