mediawiki-extensions-Multim.../tests/qunit/mmv/logging/mmv.logging.DimensionLogger.test.js
Gergő Tisza ff76011032 Log image dimensions
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
2014-09-30 14:55:47 +00:00

18 lines
585 B
JavaScript

( function ( mw, $ ) {
QUnit.module( 'mmv.logging.DimensionLogger', QUnit.newMwEnvironment() );
QUnit.test( 'log()', 1, function ( assert ) {
var fakeEventLog = { logEvent : this.sandbox.stub() },
logger = new mw.mmv.logging.DimensionLogger();
this.sandbox.stub( logger, 'loadDependencies' ).returns( $.Deferred().resolve() );
this.sandbox.stub( mw, 'log' );
logger.samplingFactor = 1;
logger.setEventLog( fakeEventLog );
logger.logDimensions( 640, 480, 200, 'resize' );
assert.ok( true, 'logDimensions() did not throw errors' );
} );
}( mediaWiki, jQuery ) );