chore(test): use createKeyEvent util

Related to #321
This commit is contained in:
pedesen 2015-08-03 11:49:06 +02:00 committed by Ricardo Matias
parent 2c3c422e93
commit 8e9beeaae2
1 changed files with 6 additions and 18 deletions

View File

@ -9,26 +9,13 @@ var coreModule = require('../../../../lib/core'),
keyboardModule = require('../../../../lib/features/keyboard'),
selectionModule = require('diagram-js/lib/features/selection'),
spaceToolModule = require('diagram-js/lib/features/space-tool'),
lassoToolModule = require('diagram-js/lib/features/lasso-tool');
lassoToolModule = require('diagram-js/lib/features/lasso-tool'),
zoomScrollModule = require('diagram-js/lib/navigation/zoomscroll');
var createKeyEvent = require('diagram-js/test/util/KeyEvents').createKeyEvent;
/* global bootstrapViewer, inject, sinon */
function createKeyEvent(element, code, ctrlKey) {
var e = document.createEvent('Events');
if (e.initEvent) {
e.initEvent(event, true, true);
}
e.keyCode = code;
e.which = code;
e.ctrlKey = ctrlKey;
return e;
}
describe('features - keyboard', function() {
var diagramXML = require('../../../fixtures/bpmn/simple.bpmn');
@ -39,7 +26,8 @@ describe('features - keyboard', function() {
selectionModule,
spaceToolModule,
lassoToolModule,
keyboardModule
keyboardModule,
zoomScrollModule
];
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));