2021-08-24 09:31:14 +00:00
|
|
|
QUnit.module( 've.ui.MWTransclusionOutlineButtonWidget' );
|
|
|
|
|
|
|
|
QUnit.test( 'Constructor', ( assert ) => {
|
2021-10-27 09:39:03 +00:00
|
|
|
const widget = new ve.ui.MWTransclusionOutlineButtonWidget( {} );
|
2021-08-24 09:31:14 +00:00
|
|
|
|
2021-08-24 11:36:14 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-class-state
|
2021-11-02 01:27:09 +00:00
|
|
|
assert.true( widget.$element.hasClass( 've-ui-mwTransclusionOutlineButtonWidget' ) );
|
2021-08-24 09:31:14 +00:00
|
|
|
} );
|
2022-05-04 10:00:47 +00:00
|
|
|
|
|
|
|
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 );
|
|
|
|
} );
|