mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-12-18 10:52:48 +00:00
f592eeea3b
Bug: T77349 Change-Id: I9e26dc68859d9dca3c6066837253e85a19039ce0
25 lines
544 B
JavaScript
25 lines
544 B
JavaScript
const { UiElement } = require( 'mmv' );
|
|
|
|
( function () {
|
|
QUnit.module( 'mmv.ui', QUnit.newMwEnvironment( {
|
|
beforeEach: function () {
|
|
this.clock = this.sandbox.useFakeTimers();
|
|
}
|
|
} ) );
|
|
|
|
QUnit.test( 'handleEvent()', function ( assert ) {
|
|
const element = new UiElement( $( '<div>' ) );
|
|
|
|
element.handleEvent( 'mmv-foo', function () {
|
|
assert.true( true, 'Event is handled' );
|
|
} );
|
|
|
|
$( document ).trigger( new $.Event( 'mmv-foo' ) );
|
|
|
|
element.clearEvents();
|
|
|
|
$( document ).trigger( new $.Event( 'mmv-foo' ) );
|
|
} );
|
|
|
|
}() );
|