Debian Codegraph @

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

raw symbols SCIP
1 QUnit.module( 've.ui.MWTransclusionOutlineButtonWidget' );
2
3 QUnit.test( 'Constructor', ( assert ) => {
4 const widget = new ve.ui.MWTransclusionOutlineButtonWidget( {} );
5
6 // eslint-disable-next-line no-jquery/no-class-state
7 assert.true( widget.$element.hasClass( 've-ui-mwTransclusionOutlineButtonWidget' ) );
8 } );
9
10 QUnit.test( 'onKeyDown', ( assert ) => {
11 const done = assert.async(),
12 widget = new ve.ui.MWTransclusionOutlineButtonWidget( {} ),
13 event = $.Event( 'keydown', { which: 32 } );
14
15 widget.on( 'keyPressed', ( key ) => {
16 assert.strictEqual( key, 32 );
17 done();
18 } );
19 widget.onKeyDown( event );
20 } );