mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-17 21:04:11 +00:00
ff76011032
Also add a sanity test to attribution logging which I forgot at the time. Change-Id: I3010e57eb74a76fee4078c415182a033375ea890 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/898
23 lines
767 B
JavaScript
23 lines
767 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 ) );
|