Page MenuHomeWickedGov Phorge

ve.ui.MWUseExistingReferenceCommand.test.js
No OneTemporary

Size
845 B
Referenced Files
None
Subscribers
None

ve.ui.MWUseExistingReferenceCommand.test.js

'use strict';
QUnit.module( 've.ui.MWUseExistingReferenceCommand (Cite)', ve.test.utils.newMwEnvironment() );
function getFragmentMock( hasRefs ) {
return {
getDocument: () => ( {
getInternalList: () => ( {
getItemNodeCount: () => hasRefs ? 1 : 0
} )
} ),
getSelection: () => ( {
getName: () => 'linear'
} )
};
}
QUnit.test( 'Constructor', ( assert ) => {
const command = new ve.ui.MWUseExistingReferenceCommand();
assert.strictEqual( command.name, 'reference/existing' );
assert.strictEqual( command.action, 'window' );
assert.strictEqual( command.method, 'open' );
} );
QUnit.test( 'isExecutable', ( assert ) => {
const command = new ve.ui.MWUseExistingReferenceCommand();
assert.false( command.isExecutable( getFragmentMock( false ) ) );
assert.true( command.isExecutable( getFragmentMock( true ) ) );
} );

File Metadata

Mime Type
text/plain
Expires
Aug 19 2026, 22:43 (8 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0f/ba/351f44e72731e4a74ec9ede2f1c2
Default Alt Text
ve.ui.MWUseExistingReferenceCommand.test.js (845 B)

Event Timeline