chore(tests): depend on move module, where used

Tests would otherwise break in the future.

Related to bpmn-io/diagram-js#152
This commit is contained in:
Nico Rehwaldt 2017-12-10 23:04:08 +01:00
parent 36a12396fd
commit e7da5af0a1
3 changed files with 42 additions and 12 deletions

View File

@ -11,6 +11,7 @@ var autoResizeModule = require('../../../../lib/features/auto-resize'),
modelingModule = require('../../../../lib/features/modeling'),
createModule = require('diagram-js/lib/features/create'),
coreModule = require('../../../../lib/core'),
moveModule = require('diagram-js/lib/features/move'),
canvasEvent = require('../../../util/MockEvents').createCanvasEvent;
function getBounds(shape) {
@ -20,8 +21,13 @@ function getBounds(shape) {
describe('features/auto-resize', function() {
var testModules = [ coreModule, modelingModule, autoResizeModule, createModule ];
var testModules = [
coreModule,
modelingModule,
autoResizeModule,
createModule,
moveModule
];
describe('participant', function() {
@ -32,7 +38,9 @@ describe('features/auto-resize', function() {
startEventShape,
originalBounds;
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
beforeEach(inject(function(elementRegistry) {
@ -285,7 +293,9 @@ describe('features/auto-resize', function() {
var diagramXML = require('./AutoResize.lanes.bpmn');
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
it('should fit new element', inject(function(elementRegistry, modeling) {
@ -326,7 +336,9 @@ describe('features/auto-resize', function() {
var diagramXML = require('./AutoResize.sub-processes.bpmn');
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
it('should auto-resize after moving children', inject(function(elementRegistry, modeling) {
@ -433,7 +445,9 @@ describe('features/auto-resize', function() {
var diagramXML = require('./AutoResize.multi-selection.bpmn');
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
var taskShape_1,
taskShape_2,
@ -567,6 +581,7 @@ describe('features/auto-resize', function() {
});
describe('space-tool', function() {
var diagramXML = require('./AutoResize.space-tool.bpmn');
@ -575,7 +590,9 @@ describe('features/auto-resize', function() {
participantShape,
originalBounds;
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
beforeEach(inject(function(elementRegistry) {

View File

@ -8,6 +8,7 @@ var is = require('../../../../../lib/util/ModelUtil').is,
find = require('lodash/collection/find');
var modelingModule = require('../../../../../lib/features/modeling'),
moveModule = require('diagram-js/lib/features/move'),
coreModule = require('../../../../../lib/core');
var canvasEvent = require('../../../../util/MockEvents').createCanvasEvent;
@ -31,7 +32,11 @@ function expectNotConnected(source, target, connectionOrType) {
describe('features/modeling - replace connection', function() {
var testModules = [ coreModule, modelingModule ];
var testModules = [
coreModule,
moveModule,
modelingModule
];
describe('should replace SequenceFlow <> MessageFlow', function() {
@ -321,7 +326,9 @@ describe('features/modeling - replace connection', function() {
var processDiagramXML = require('./ReplaceConnectionBehavior.boundary-events.bpmn');
beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(processDiagramXML, {
modules: testModules
}));
var element;

View File

@ -5,6 +5,7 @@ require('../../../TestHelper');
/* global bootstrapModeler, inject */
var replacePreviewModule = require('../../../../lib/features/replace-preview'),
moveModule = require('diagram-js/lib/features/move'),
modelingModule = require('../../../../lib/features/modeling'),
coreModule = require('../../../../lib/core');
@ -19,8 +20,6 @@ var svgAttr = require('tiny-svg/lib/attr'),
describe('features/replace-preview', function() {
var testModules = [ replacePreviewModule, modelingModule, coreModule ];
var diagramXML = require('../../../fixtures/bpmn/event-sub-processes.bpmn');
var startEvent_1,
@ -29,7 +28,14 @@ describe('features/replace-preview', function() {
var getGfx,
moveShape;
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
beforeEach(bootstrapModeler(diagramXML, {
modules: [
replacePreviewModule,
moveModule,
modelingModule,
coreModule
]
}));
beforeEach(inject(function(canvas, elementRegistry, elementFactory, move, dragging) {