mediawiki-extensions-Visual.../modules/ve/test/ve.Trigger.test.js
James D. Forrester 82114467f1 Bump copyright notice year range to -2013 over -2012
199 files touched. Whee!

Change-Id: Id82ce4a32f833406db4a1cc585674f2bdb39ba0d
2013-02-19 15:37:34 -08:00

37 lines
794 B
JavaScript

/*!
* VisualEditor Trigger tests.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.Trigger' );
/* Tests */
QUnit.test( 'constructor', function ( assert ) {
function event( options ) {
return jQuery.Event( 'keydown', options );
}
var i, len,
tests = [
{
'trigger': 'ctrl+b',
'event': event( { 'ctrlKey': true, 'which': 66 } )
}
];
QUnit.expect( 2 * tests.length );
for ( i = 0, len = tests.length; i < len; i++ ) {
assert.equal(
new ve.Trigger( tests[i].trigger ).toString(),
tests[i].trigger,
'trigger is parsed correctly'
);
assert.equal(
new ve.Trigger( tests[i].event ).toString(),
tests[i].trigger,
'event is parsed correctly'
);
}
} );