mediawiki-extensions-Multim.../tests/qunit/mmv/logging/mmv.logging.AttributionLogger.test.js
Fomafix ae99be730e Apply coding conventions for JavaScript
Change-Id: I57a8f188eb1152438a8e94235a6f6801e2617c28
2015-01-23 12:48:27 +00:00

23 lines
766 B
JavaScript

( function ( mw, $ ) {
QUnit.module( 'mmv.logging.AttributionLogger', QUnit.newMwEnvironment() );
QUnit.test( 'log()', 2, function ( assert ) {
var fakeEventLog = { logEvent: this.sandbox.stub() },
logger = new mw.mmv.logging.AttributionLogger(),
image = { author: 'foo', source: 'bar', license: {} },
emptyImage = {};
this.sandbox.stub( logger, 'loadDependencies' ).returns( $.Deferred().resolve() );
this.sandbox.stub( mw, 'log' );
logger.samplingFactor = 1;
logger.setEventLog( fakeEventLog );
logger.logAttribution( image );
assert.ok( true, 'logDimensions() did not throw errors' );
logger.logAttribution( emptyImage );
assert.ok( true, 'logDimensions() did not throw errors for empty image' );
} );
}( mediaWiki, jQuery ) );