mediawiki-extensions-Multim.../tests/qunit/mmv/logging/mmv.logging.AttributionLogger.test.js
Ed Sanders 1ded292f83 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ice695dfb489974faa23ba19d74cf17b06e3f6075
2018-11-12 16:33:24 +00:00

23 lines
737 B
JavaScript

( function () {
QUnit.module( 'mmv.logging.AttributionLogger', QUnit.newMwEnvironment() );
QUnit.test( 'log()', 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' );
} );
}() );