QUnit.expect( 2 );
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 ) {
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' );