mediawiki-extensions-Multim.../tests/qunit/multilightbox.test.js
Aaron Arcos ffc8f4948d Add smoke test to class mw.LightboxInterface.
- Moved tests that were meant for LightboxInterface objects.
  - Fixed space naming issues.

Change-Id: Ib83904eab5fa542330ea559d420efa5f1de8c3eb
2013-12-13 10:39:13 -08:00

16 lines
778 B
JavaScript

( function () {
QUnit.module( 'ext.multimediaViewer.multilightbox.multiLightbox', QUnit.newMwEnvironment() );
QUnit.test( 'Smoke test', 3, function ( assert ) {
function DummyClass() {}
var lightboxImage = new window.LightboxImage( 'http://en.wikipedia.org/w/skins/vector/images/search-ltr.png' ),
multiLightbox = new window.MultiLightbox( [lightboxImage] ),
multilightbox2 = new window.MultiLightbox( [lightboxImage], 0, DummyClass );
assert.strictEqual( multiLightbox.currentIndex, 0, 'currentIndex initialized correctly.' );
assert.ok( multiLightbox.iface instanceof window.LightboxInterface, 'Using default LightboxInterface class' );
assert.ok( multilightbox2.iface instanceof DummyClass, 'Using injected DummyClass' );
} );
}( mediaWiki, jQuery ) );