mediawiki-extensions-Multim.../tests/qunit/mmv/logging/mmv.logging.AttributionLogger.test.js
Timo Tijhof 5bf1466e7f Remove use of QUnit.test(, testCount, )
* Removed deprecated testCount, which is no longer supported in this way.
  It's only useful when wanting to explicitly expect 0 assertions (normally
  considered an error).
* Replaced use of testCount = 0, with assert.expect( 0 ).

Change-Id: I8fe82032d3af2a1ad2ed7febdb90a95d56dd3fc4
2017-07-26 00:12:06 +00:00

23 lines
763 B
JavaScript

( 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 ) );