Merge "Rank aliases in search in order they appear in the messages file."
[lhc/web/wiklou.git] / tests / qunit / suites / resources / mediawiki.api / mediawiki.api.upload.test.js
index 1afbd35..b1bd12b 100644 (file)
@@ -1,16 +1,15 @@
 ( function ( mw, $ ) {
        QUnit.module( 'mediawiki.api.upload', QUnit.newMwEnvironment( {} ) );
 
-       QUnit.test( 'Basic functionality', function ( assert ) {
-               QUnit.expect( 2 );
+       QUnit.test( 'Basic functionality', 2, function ( assert ) {
                var api = new mw.Api();
                assert.ok( api.upload );
-               // The below will return a rejected deferred, but that's OK.
-               assert.ok( api.upload() );
+               assert.throws( function () {
+                       api.upload();
+               } );
        } );
 
-       QUnit.test( 'Set up iframe upload', function ( assert ) {
-               QUnit.expect( 5 );
+       QUnit.test( 'Set up iframe upload', 5, function ( assert ) {
                var $iframe, $form, $input,
                        api = new mw.Api();
 
@@ -18,7 +17,7 @@
                        return $.Deferred().promise();
                } );
 
-               api.uploadWithIframe( $( '<input>' )[0], { filename: 'Testing API upload.jpg' } );
+               api.uploadWithIframe( $( '<input>' )[ 0 ], { filename: 'Testing API upload.jpg' } );
 
                $iframe = $( 'iframe' );
                $form = $( 'form.mw-api-upload-form' );