When running the tests locally the mediawiki.toc tests often
fail because where it asserts hidden it is visible, and where it
asserts visible it is hidden (this happens if you've ever closed
a "toc" section on your local wiki, causes the tests to be one-off).
Change-Id: Idc5e7123f3be3e11dac50d76d13089a2fabcfdb5
( function ( mw, $ ) {
- QUnit.module( 'mediawiki.toc', QUnit.newMwEnvironment() );
+ QUnit.module( 'mediawiki.toc', QUnit.newMwEnvironment( {
+ setup: function () {
+ // Prevent live cookies like mw_hidetoc=1 from interferring with the test
+ this.stub( $, 'cookie' ).returns( null );
+ }
+ } ) );
QUnit.asyncTest( 'toggleToc', 4, function ( assert ) {
var tocHtml, $toggleLink, $tocList;