mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Fix mmv.lightboxInterface qunit tests
Bug: T164473 Change-Id: I5d2ddba1e1a5cb69de276d790841536fde77d108
This commit is contained in:
parent
65c00b388c
commit
4c3302d957
|
@ -56,7 +56,8 @@
|
|||
|
||||
QUnit.test( 'Handler registration and clearance work OK', 2, function ( assert ) {
|
||||
var lightbox = new mw.mmv.LightboxInterface(),
|
||||
handlerCalls = 0;
|
||||
handlerCalls = 0,
|
||||
clock = this.sandbox.useFakeTimers();
|
||||
|
||||
function handleEvent() {
|
||||
handlerCalls++;
|
||||
|
@ -64,10 +65,16 @@
|
|||
|
||||
lightbox.handleEvent( 'test', handleEvent );
|
||||
$( document ).trigger( 'test' );
|
||||
clock.tick( 10 );
|
||||
assert.strictEqual( handlerCalls, 1, 'The handler was called when we triggered the event.' );
|
||||
|
||||
lightbox.clearEvents();
|
||||
|
||||
$( document ).trigger( 'test' );
|
||||
clock.tick( 10 );
|
||||
assert.strictEqual( handlerCalls, 1, 'The handler was not called after calling lightbox.clearEvents().' );
|
||||
|
||||
clock.restore();
|
||||
} );
|
||||
|
||||
QUnit.test( 'Fullscreen mode', 8, function ( assert ) {
|
||||
|
@ -98,7 +105,7 @@
|
|||
$.support.fullscreen = true;
|
||||
lightbox.setupCanvasButtons();
|
||||
|
||||
assert.strictEqual( lightbox.$fullscreenButton.css( 'display' ), 'inline-block',
|
||||
assert.strictEqual( lightbox.$fullscreenButton.css( 'display' ), '',
|
||||
'Fullscreen button is visible when fullscreen mode is available' );
|
||||
|
||||
// Entering fullscreen
|
||||
|
|
Loading…
Reference in a new issue