qunit: Update tests to not assume animations use setTimeout
[lhc/web/wiklou.git] / tests / qunit / suites / resources / jquery / jquery.makeCollapsible.test.js
index c51e409..9c7660f 100644 (file)
@@ -1,11 +1,7 @@
 ( function ( mw, $ ) {
        var loremIpsum = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.';
 
-       QUnit.module( 'jquery.makeCollapsible', QUnit.newMwEnvironment( {
-               setup: function () {
-                       this.clock = this.sandbox.useFakeTimers();
-               }
-       } ) );
+       QUnit.module( 'jquery.makeCollapsible', QUnit.newMwEnvironment() );
 
        function prepareCollapsible( html, options ) {
                return $( $.parseHTML( html ) )
 
                        // ...expanding happens here
                        $toggle.trigger( 'click' );
-                       test.clock.tick( 500 );
                } );
 
                // ...collapsing happens here
                $toggle.trigger( 'click' );
-               test.clock.tick( 500 );
        } );
 
        QUnit.test( 'basic operation (<div>)', 5, function ( assert ) {
                        } );
 
                        $toggle.trigger( 'click' );
-                       test.clock.tick( 500 );
                } );
 
                $toggle.trigger( 'click' );
-               test.clock.tick( 500 );
        } );
 
        QUnit.test( 'basic operation (<table>)', 7, function ( assert ) {
                        } );
 
                        $toggle.trigger( 'click' );
-                       test.clock.tick( 500 );
                } );
 
                $toggle.trigger( 'click' );
-               test.clock.tick( 500 );
        } );
 
        function tableWithCaptionTest( $collapsible, test, assert ) {
                        } );
 
                        $toggle.trigger( 'click' );
-                       test.clock.tick( 500 );
                } );
 
                $toggle.trigger( 'click' );
-               test.clock.tick( 500 );
        }
 
        QUnit.test( 'basic operation (<table> with caption)', 10, function ( assert ) {
                        } );
 
                        $toggle.trigger( 'click' );
-                       test.clock.tick( 500 );
                } );
 
                $toggle.trigger( 'click' );
-               test.clock.tick( 500 );
        }
 
        QUnit.test( 'basic operation (<ul>)', 7, function ( assert ) {
                } );
 
                $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' );
-               this.clock.tick( 500 );
        } );
 
        QUnit.test( 'initial collapse (options.collapsed)', 2, function ( assert ) {
                } );
 
                $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' );
-               this.clock.tick( 500 );
        } );
 
        QUnit.test( 'clicks on links inside toggler pass through (options.linksPassthru)', 2, function ( assert ) {
                } );
 
                $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' );
-               this.clock.tick( 500 );
        } );
 
        QUnit.test( 'collapse/expand text (options.collapseText, options.expandText)', 2, function ( assert ) {
                } );
 
                $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' );
-               this.clock.tick( 500 );
        } );
 
        QUnit.test( 'cloned collapsibles can be made collapsible again', 2, function ( assert ) {
                } );
 
                $clone.find( '.mw-collapsible-toggle a' ).trigger( 'click' );
-               test.clock.tick( 500 );
        } );
 }( mediaWiki, jQuery ) );