From a1be2ea631b1e52c6cd962148866d1a738896dce Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Fri, 19 Jul 2019 13:49:24 +0200 Subject: [PATCH] test(project): register BpmnJS in integration tests --- test/spec/ModelerSpec.js | 9 +++++++++ test/spec/NavigatedViewerSpec.js | 10 ++++++++++ test/spec/ViewerSpec.js | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/test/spec/ModelerSpec.js b/test/spec/ModelerSpec.js index 7d2981b1..a77b252f 100644 --- a/test/spec/ModelerSpec.js +++ b/test/spec/ModelerSpec.js @@ -8,6 +8,11 @@ import { createEvent } from '../util/MockEvents'; +import { + setBpmnJS, + clearBpmnJS +} from 'test/TestHelper'; + describe('Modeler', function() { @@ -21,6 +26,8 @@ describe('Modeler', function() { function createModeler(xml, done) { + clearBpmnJS(); + modeler = new Modeler({ container: container, keyboard: { @@ -28,6 +35,8 @@ describe('Modeler', function() { } }); + setBpmnJS(modeler); + modeler.importXML(xml, function(err, warnings) { done(err, warnings, modeler); }); diff --git a/test/spec/NavigatedViewerSpec.js b/test/spec/NavigatedViewerSpec.js index 10612cdc..4271ba36 100644 --- a/test/spec/NavigatedViewerSpec.js +++ b/test/spec/NavigatedViewerSpec.js @@ -4,6 +4,11 @@ import EditorActionsModule from 'lib/features/editor-actions'; import TestContainer from 'mocha-test-container-support'; +import { + setBpmnJS, + clearBpmnJS +} from 'test/TestHelper'; + describe('NavigatedViewer', function() { @@ -14,10 +19,15 @@ describe('NavigatedViewer', function() { }); function createViewer(xml, done) { + + clearBpmnJS(); + var viewer = new NavigatedViewer({ container: container }); + setBpmnJS(viewer); + viewer.importXML(xml, function(err, warnings) { done(err, warnings, viewer); }); diff --git a/test/spec/ViewerSpec.js b/test/spec/ViewerSpec.js index 73f24332..bf59f516 100644 --- a/test/spec/ViewerSpec.js +++ b/test/spec/ViewerSpec.js @@ -12,6 +12,11 @@ import { isFunction } from 'min-dash'; +import { + setBpmnJS, + clearBpmnJS +} from 'test/TestHelper'; + describe('Viewer', function() { @@ -28,8 +33,12 @@ describe('Viewer', function() { diagramId = null; } + clearBpmnJS(); + var viewer = new Viewer({ container: container }); + setBpmnJS(viewer); + viewer.importXML(xml, diagramId, function(err, warnings) { done(err, warnings, viewer); });