Matthias Mullie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353999 )

Change subject: Fix mmv.lightboxInterface qunit tests
......................................................................

Fix mmv.lightboxInterface qunit tests

Bug: T164473
Change-Id: I5d2ddba1e1a5cb69de276d790841536fde77d108
---
M tests/qunit/mmv/mmv.lightboxinterface.test.js
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/99/353999/1

diff --git a/tests/qunit/mmv/mmv.lightboxinterface.test.js 
b/tests/qunit/mmv/mmv.lightboxinterface.test.js
index 2922581..9003c38 100644
--- a/tests/qunit/mmv/mmv.lightboxinterface.test.js
+++ b/tests/qunit/mmv/mmv.lightboxinterface.test.js
@@ -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

-- 
To view, visit https://gerrit.wikimedia.org/r/353999
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d2ddba1e1a5cb69de276d790841536fde77d108
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to