(bug 37390) Clean up QUnit test suites
[lhc/web/wiklou.git] / tests / qunit / suites / resources / mediawiki.special / mediawiki.special.recentchanges.test.js
index d73fe5a..7fe7baf 100644 (file)
@@ -1,13 +1,8 @@
-module( 'mediawiki.special.recentchanges', QUnit.newMwEnvironment() );
+QUnit.module( 'mediawiki.special.recentchanges', QUnit.newMwEnvironment() );
 
-test( '-- Initial check', function() {
-       expect( 2 );
-       ok( mw.special.recentchanges.init, 'mw.special.recentchanges.init defined' );
-       ok( mw.special.recentchanges.updateCheckboxes, 'mw.special.recentchanges.updateCheckboxes defined' );
-       // TODO: verify checkboxes == [ 'nsassociated', 'nsinvert' ]
-});
+// TODO: verify checkboxes == [ 'nsassociated', 'nsinvert' ]
 
-test( '"all" namespace disable checkboxes', function() {
+QUnit.test( '"all" namespace disable checkboxes', function ( assert ) {
 
        // from Special:Recentchanges
        var select =
@@ -33,15 +28,15 @@ test( '"all" namespace disable checkboxes', function() {
        // TODO abstract the double strictEquals
 
        // At first checkboxes are enabled
-       strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
-       strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
+       assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
+       assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
 
        // Initiate the recentchanges module
        mw.special.recentchanges.init();
 
        // By default
-       strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
-       strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
+       assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
+       assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
 
        // select second option...
        var $options = $( '#namespace' ).find( 'option' );
@@ -50,8 +45,8 @@ test( '"all" namespace disable checkboxes', function() {
        $( '#namespace' ).change();
 
        // ... and checkboxes should be enabled again
-       strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
-       strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
+       assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
+       assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
 
        // select first option ( 'all' namespace)...
        $options.eq(1).removeProp( 'selected' );
@@ -59,8 +54,8 @@ test( '"all" namespace disable checkboxes', function() {
        $( '#namespace' ).change();
 
        // ... and checkboxes should now be disabled
-       strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
-       strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
+       assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
+       assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
 
        // DOM cleanup
        $env.remove();