mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-17 21:04:11 +00:00
d34fec4ff2
Also move some things around a liiiittle bit. Not too much. Change-Id: I7a5b8d900f5173fa20142d205e4992361b9e81a3 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/41
30 lines
875 B
JavaScript
30 lines
875 B
JavaScript
( function ( /** mw, $ ** Commentted to keep lint happy, uncomment when needed */) {
|
|
QUnit.module( 'multilightbox.image', QUnit.newMwEnvironment() );
|
|
|
|
QUnit.asyncTest( 'Sanity test, object creation and image loading', 1, function ( assert ) {
|
|
var lightboxImage = new window.LightboxImage( 'http://en.wikipedia.org/w/skins/vector/images/search-ltr.png' );
|
|
|
|
// Function to be called if loading is successful
|
|
function loadCallback() {
|
|
assert.ok( true, 'Image loaded !' );
|
|
QUnit.start();
|
|
}
|
|
|
|
lightboxImage.getImageElement()
|
|
.done( loadCallback );
|
|
} );
|
|
|
|
QUnit.asyncTest( 'Image failing', 1, function ( assert ) {
|
|
var lightboxImage = new window.LightboxImage( 'fail' );
|
|
|
|
function errorCallback() {
|
|
assert.ok( true, 'Image failed !' );
|
|
QUnit.start();
|
|
}
|
|
|
|
lightboxImage.getImageElement()
|
|
.fail( errorCallback );
|
|
} );
|
|
|
|
}( mediaWiki, jQuery ) );
|