blob: e62d8109b31cc1c5e68ef993cd888114208c5e89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
( function ( mw, $ ) {
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' );
} );
}( mediaWiki, jQuery ) );
|