test(Modeler): bind keyboard

This commit is contained in:
Nico Rehwaldt 2018-04-02 09:12:44 +02:00
parent 2541ce6cb9
commit 44a08ae6a3
1 changed files with 17 additions and 1 deletions

View File

@ -4,17 +4,33 @@ var Modeler = require('lib/Modeler');
var TestContainer = require('mocha-test-container-support');
describe('Modeler', function() {
var container;
var modeler;
beforeEach(function() {
container = TestContainer.get(this);
});
afterEach(function() {
if (modeler) {
modeler.destroy();
}
modeler = null;
});
function createModeler(xml, done) {
var modeler = new Modeler({ container: container });
modeler = new Modeler({
container: container,
keyboard: {
bindTo: document
}
});
modeler.importXML(xml, function(err, warnings) {
done(err, warnings, modeler);