2018-11-12 16:33:24 +00:00
|
|
|
( function () {
|
2014-09-26 18:37:53 +00:00
|
|
|
QUnit.module( 'mmv.logging.AttributionLogger', QUnit.newMwEnvironment() );
|
|
|
|
|
2017-07-25 23:38:21 +00:00
|
|
|
QUnit.test( 'log()', function ( assert ) {
|
2015-01-23 12:48:27 +00:00
|
|
|
var fakeEventLog = { logEvent: this.sandbox.stub() },
|
2014-09-26 18:37:53 +00:00
|
|
|
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' );
|
|
|
|
} );
|
2018-11-12 16:33:24 +00:00
|
|
|
}() );
|