mediawiki-extensions-Visual.../modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineButtonWidget.test.js

21 lines
620 B
JavaScript
Raw Normal View History

QUnit.module( 've.ui.MWTransclusionOutlineButtonWidget' );
QUnit.test( 'Constructor', ( assert ) => {
const widget = new ve.ui.MWTransclusionOutlineButtonWidget( {} );
// eslint-disable-next-line no-jquery/no-class-state
assert.true( widget.$element.hasClass( 've-ui-mwTransclusionOutlineButtonWidget' ) );
} );
QUnit.test( 'onKeyDown', ( assert ) => {
const done = assert.async(),
widget = new ve.ui.MWTransclusionOutlineButtonWidget( {} ),
event = $.Event( 'keydown', { which: 32 } );
widget.on( 'keyPressed', ( key ) => {
assert.strictEqual( key, 32 );
done();
} );
widget.onKeyDown( event );
} );