mediawiki-extensions-Multim.../tests/qunit/mmv/ui/mmv.ui.test.js
Derk-Jan Hartman f592eeea3b Remove unused code from mmv.ui
Bug: T77349
Change-Id: I9e26dc68859d9dca3c6066837253e85a19039ce0
2024-05-20 23:02:04 +00:00

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' ) );
} );
}() );