2018-04-02 19:01:53 +00:00
|
|
|
import {
|
|
|
|
bootstrapModeler,
|
|
|
|
inject
|
|
|
|
} from 'test/TestHelper';
|
2014-07-30 14:06:32 +00:00
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
import modelingModule from 'lib/features/modeling';
|
|
|
|
import coreModule from 'lib/core';
|
2019-05-03 13:15:40 +00:00
|
|
|
|
2019-05-09 08:14:27 +00:00
|
|
|
import bendpointsModule from 'diagram-js/lib/features/bendpoints';
|
2019-05-17 11:11:17 +00:00
|
|
|
import connectionPreviewModule from 'diagram-js/lib/features/connection-preview';
|
2019-05-13 14:09:14 +00:00
|
|
|
import connectModule from 'diagram-js/lib/features/connect';
|
|
|
|
import createModule from 'diagram-js/lib/features/create';
|
2019-05-09 14:12:25 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
import {
|
|
|
|
createCanvasEvent as canvasEvent
|
|
|
|
} from '../../../../util/MockEvents';
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
|
2019-06-05 14:16:40 +00:00
|
|
|
var testModules = [
|
|
|
|
bendpointsModule,
|
|
|
|
connectionPreviewModule,
|
|
|
|
connectModule,
|
|
|
|
coreModule,
|
|
|
|
createModule,
|
|
|
|
modelingModule
|
|
|
|
];
|
|
|
|
|
|
|
|
|
2014-07-30 14:06:32 +00:00
|
|
|
describe('features/modeling - layout connection', function() {
|
|
|
|
|
2015-07-29 13:11:54 +00:00
|
|
|
var diagramXML = require('../../../../fixtures/bpmn/sequence-flows.bpmn');
|
2014-07-30 14:06:32 +00:00
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
beforeEach(bootstrapModeler(diagramXML, {
|
2019-06-05 14:16:40 +00:00
|
|
|
modules: testModules
|
2017-12-10 11:29:54 +00:00
|
|
|
}));
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
describe('should not touch already layouted', function() {
|
2014-07-30 14:06:32 +00:00
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
it('execute', inject(function(elementRegistry, modeling, bpmnFactory) {
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
// given
|
2014-11-17 16:36:22 +00:00
|
|
|
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
|
2014-07-30 14:06:32 +00:00
|
|
|
sequenceFlow = sequenceFlowConnection.businessObject;
|
|
|
|
|
2016-06-26 21:42:11 +00:00
|
|
|
var expectedWaypoints = sequenceFlowConnection.waypoints;
|
|
|
|
|
2014-07-30 14:06:32 +00:00
|
|
|
// when
|
|
|
|
modeling.layoutConnection(sequenceFlowConnection);
|
|
|
|
|
|
|
|
// then
|
|
|
|
|
2014-09-04 11:47:11 +00:00
|
|
|
// expect cropped, repaired connection
|
2015-04-22 07:08:38 +00:00
|
|
|
// that was not actually modified
|
2015-08-24 09:28:54 +00:00
|
|
|
|
2016-06-26 21:42:11 +00:00
|
|
|
expect(sequenceFlowConnection.waypoints).to.eql(expectedWaypoints);
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
// expect cropped waypoints in di
|
2016-06-26 21:42:11 +00:00
|
|
|
var diWaypoints = bpmnFactory.createDiWaypoints(expectedWaypoints);
|
2015-07-15 15:22:19 +00:00
|
|
|
|
|
|
|
expect(sequenceFlow.di.waypoint).eql(diWaypoints);
|
2014-07-30 14:06:32 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
it('undo', inject(function(elementRegistry, commandStack, modeling) {
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
// given
|
2014-11-17 16:36:22 +00:00
|
|
|
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
|
2014-07-30 14:06:32 +00:00
|
|
|
sequenceFlow = sequenceFlowConnection.businessObject;
|
|
|
|
|
|
|
|
var oldWaypoints = sequenceFlowConnection.waypoints,
|
|
|
|
oldDiWaypoints = sequenceFlow.di.waypoint;
|
|
|
|
|
|
|
|
modeling.layoutConnection(sequenceFlowConnection);
|
|
|
|
|
|
|
|
// when
|
|
|
|
commandStack.undo();
|
|
|
|
|
|
|
|
// then
|
2015-07-15 15:22:19 +00:00
|
|
|
expect(sequenceFlowConnection.waypoints).eql(oldWaypoints);
|
|
|
|
expect(sequenceFlow.di.waypoint).eql(oldDiWaypoints);
|
2014-07-30 14:06:32 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
it('redo', inject(function(elementRegistry, commandStack, modeling) {
|
2014-07-30 14:06:32 +00:00
|
|
|
|
|
|
|
// given
|
2014-11-17 16:36:22 +00:00
|
|
|
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
|
2014-07-30 14:06:32 +00:00
|
|
|
sequenceFlow = sequenceFlowConnection.businessObject;
|
|
|
|
|
|
|
|
modeling.layoutConnection(sequenceFlowConnection);
|
|
|
|
|
|
|
|
var newWaypoints = sequenceFlowConnection.waypoints,
|
|
|
|
newDiWaypoints = sequenceFlow.di.waypoint;
|
|
|
|
|
|
|
|
// when
|
|
|
|
commandStack.undo();
|
|
|
|
commandStack.redo();
|
|
|
|
|
|
|
|
// then
|
2015-07-15 15:22:19 +00:00
|
|
|
expect(sequenceFlowConnection.waypoints).eql(newWaypoints);
|
|
|
|
expect(sequenceFlow.di.waypoint).eql(newDiWaypoints);
|
2014-07-30 14:06:32 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-12-10 11:29:54 +00:00
|
|
|
|
|
|
|
it('should remove un-needed waypoints', inject(function(elementRegistry, modeling) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var taskShape = elementRegistry.get('Task_2'),
|
|
|
|
sequenceFlowConnection = elementRegistry.get('SequenceFlow_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
// moving task
|
|
|
|
modeling.moveElements([ taskShape ], { x: 250, y: -95 });
|
|
|
|
|
|
|
|
// then
|
|
|
|
var newWaypoints = sequenceFlowConnection.waypoints;
|
|
|
|
|
|
|
|
expect(newWaypoints.map(toPoint)).to.eql([
|
|
|
|
{ x: 578, y: 341 },
|
|
|
|
{ x: 982, y: 341 }
|
|
|
|
]);
|
|
|
|
}));
|
|
|
|
|
2019-04-18 12:22:21 +00:00
|
|
|
|
|
|
|
describe('integration', function() {
|
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
describe('re-connection', function() {
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
it('should correctly layout after start re-connection', inject(function(elementRegistry, modeling) {
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// given
|
|
|
|
var task1 = elementRegistry.get('Task_1'),
|
|
|
|
connection = elementRegistry.get('SequenceFlow_1'),
|
|
|
|
docking = { x: 292, y: 376 };
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// when
|
|
|
|
modeling.reconnectStart(connection, task1, docking);
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// then
|
|
|
|
var waypoints = connection.waypoints,
|
|
|
|
i,
|
|
|
|
first,
|
|
|
|
second;
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
for (i = 0; i < waypoints.length - 1; i++) {
|
|
|
|
first = waypoints[i];
|
|
|
|
second = waypoints[i + 1];
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
expect(areOnSameAxis(first, second), 'points are on different axes').to.be.true;
|
|
|
|
}
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
}));
|
2019-04-18 12:22:21 +00:00
|
|
|
|
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
it('should correctly layout after end re-connection', inject(function(elementRegistry, modeling) {
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// given
|
|
|
|
var task1 = elementRegistry.get('Task_1'),
|
|
|
|
connection = elementRegistry.get('SequenceFlow_1'),
|
|
|
|
docking = { x: 292, y: 376 };
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// when
|
|
|
|
modeling.reconnectEnd(connection, task1, docking);
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// then
|
|
|
|
var waypoints = connection.waypoints,
|
|
|
|
i,
|
|
|
|
first,
|
|
|
|
second;
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
for (i = 0; i < waypoints.length - 1; i++) {
|
|
|
|
first = waypoints[i];
|
|
|
|
second = waypoints[i + 1];
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
expect(areOnSameAxis(first, second), 'points are on different axes').to.be.true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe('connection preview', function() {
|
|
|
|
|
|
|
|
var task;
|
|
|
|
|
|
|
|
beforeEach(inject(function(elementFactory, dragging) {
|
|
|
|
task = elementFactory.createShape({
|
|
|
|
type: 'bpmn:Task'
|
|
|
|
});
|
|
|
|
|
|
|
|
dragging.setOptions({ manual: true });
|
|
|
|
}));
|
|
|
|
|
|
|
|
afterEach(inject(function(dragging) {
|
|
|
|
dragging.setOptions({ manual: false });
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
2019-06-04 14:57:27 +00:00
|
|
|
it.skip('should correctly lay out connection preview on create',
|
2019-05-03 13:15:40 +00:00
|
|
|
inject(function(canvas, create, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var rootShape = canvas.getRootElement(),
|
|
|
|
rootShapeGfx = canvas.getGraphics(rootShape),
|
|
|
|
task1 = elementRegistry.get('Task_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
create.start(canvasEvent({ x: 0, y: 0 }), task, task1);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 175, y: 175 }));
|
|
|
|
dragging.hover({ element: rootShape, gfx: rootShapeGfx });
|
|
|
|
dragging.move(canvasEvent({ x: 200, y: 200 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
2019-05-09 12:24:12 +00:00
|
|
|
var connectionPreview = context.getConnection(
|
|
|
|
context.canExecute.connect,
|
|
|
|
context.source,
|
|
|
|
context.shape
|
|
|
|
);
|
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
2019-04-18 12:22:21 +00:00
|
|
|
|
2019-05-03 13:15:40 +00:00
|
|
|
// then
|
|
|
|
expect(task1.outgoing[0]).to.exist;
|
|
|
|
expect(task1.outgoing[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
2019-05-09 14:12:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out new connection preview',
|
|
|
|
inject(function(connect, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var task1 = elementRegistry.get('Task_1'),
|
|
|
|
task2 = elementRegistry.get('Task_2');
|
|
|
|
|
|
|
|
// when
|
|
|
|
connect.start(canvasEvent({ x: 0, y: 0 }), task1);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 760, y: 420 }));
|
|
|
|
dragging.hover({ element: task2 });
|
|
|
|
dragging.move(canvasEvent({ x: 782, y: 436 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
|
|
|
var connectionPreview = context.getConnection(
|
|
|
|
context.canExecute,
|
|
|
|
context.source,
|
|
|
|
context.target
|
|
|
|
);
|
|
|
|
|
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(task1.outgoing[0]).to.exist;
|
|
|
|
expect(task1.outgoing[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
2019-05-09 08:14:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection preview on reconnect start',
|
|
|
|
inject(function(canvas, bendpointMove, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var task1 = elementRegistry.get('Task_1'),
|
|
|
|
task1Gfx = canvas.getGraphics(task1),
|
|
|
|
sequenceFlow2 = elementRegistry.get('SequenceFlow_2');
|
|
|
|
|
|
|
|
// when
|
|
|
|
bendpointMove.start(canvasEvent({ x: 0, y: 0 }), sequenceFlow2, 0);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 230, y: 360 }));
|
|
|
|
dragging.hover({ element: task1, gfx: task1Gfx });
|
|
|
|
dragging.move(canvasEvent({ x: 248, y: 382 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
2019-05-13 14:09:14 +00:00
|
|
|
var connectionPreview = context.getConnection(
|
|
|
|
context.allowed,
|
|
|
|
context.source,
|
|
|
|
context.target
|
|
|
|
);
|
|
|
|
|
2019-05-09 08:14:27 +00:00
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(task1.outgoing[0]).to.exist;
|
|
|
|
expect(task1.outgoing[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection preview on reconnect end',
|
|
|
|
inject(function(canvas, bendpointMove, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var task1 = elementRegistry.get('Task_1'),
|
|
|
|
task1Gfx = canvas.getGraphics(task1),
|
|
|
|
sequenceFlow2 = elementRegistry.get('SequenceFlow_2');
|
|
|
|
|
|
|
|
// when
|
|
|
|
bendpointMove.start(canvasEvent({ x: 0, y: 0 }), sequenceFlow2, 2);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 230, y: 360 }));
|
|
|
|
dragging.hover({ element: task1, gfx: task1Gfx });
|
|
|
|
dragging.move(canvasEvent({ x: 248, y: 382 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
2019-05-13 14:09:14 +00:00
|
|
|
var connectionPreview = context.getConnection(
|
|
|
|
context.allowed,
|
|
|
|
context.source,
|
|
|
|
context.target
|
|
|
|
);
|
|
|
|
|
2019-05-09 08:14:27 +00:00
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(task1.incoming[0]).to.exist;
|
|
|
|
expect(task1.incoming[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
2019-05-27 14:13:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection preview on inserted bendpoint move',
|
|
|
|
inject(function(bendpointMove, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var task2 = elementRegistry.get('Task_2'),
|
|
|
|
sequenceFlow1 = elementRegistry.get('SequenceFlow_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
bendpointMove.start(canvasEvent({ x: 700, y: 341 }), sequenceFlow1, 1, true);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 700, y: 400 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
|
|
|
var connectionPreview = context.getConnection(context.allowed);
|
|
|
|
|
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(task2.incoming[0]).to.exist;
|
|
|
|
expect(task2.incoming[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection preview on existing bendpoint move',
|
|
|
|
inject(function(bendpointMove, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var task2 = elementRegistry.get('Task_2'),
|
|
|
|
sequenceFlow1 = elementRegistry.get('SequenceFlow_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
bendpointMove.start(canvasEvent({ x: 934, y: 341 }), sequenceFlow1, 1);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: 960, y: 340 }));
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
|
|
|
var connectionPreview = context.getConnection(context.allowed);
|
|
|
|
|
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(task2.incoming[0]).to.exist;
|
|
|
|
expect(task2.incoming[0].waypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
2019-05-03 13:15:40 +00:00
|
|
|
});
|
2019-05-27 08:24:28 +00:00
|
|
|
|
|
|
|
|
2019-06-05 14:16:40 +00:00
|
|
|
describe('connection preview with connection type replacement', function() {
|
|
|
|
|
|
|
|
var diagramXML = require('test/spec/features/modeling/behavior/ReplaceConnectionBehavior.message-sequence-flow.bpmn');
|
|
|
|
|
|
|
|
beforeEach(inject(function(dragging) {
|
|
|
|
dragging.setOptions({ manual: true });
|
|
|
|
}));
|
|
|
|
|
|
|
|
afterEach(inject(function(dragging) {
|
|
|
|
dragging.setOptions({ manual: false });
|
|
|
|
}));
|
|
|
|
|
|
|
|
beforeEach(bootstrapModeler(diagramXML, {
|
|
|
|
modules: testModules
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection preview when reconnecting with replacement',
|
|
|
|
inject(function(canvas, bendpointMove, dragging, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var participant2 = elementRegistry.get('Participant_2'),
|
|
|
|
participant2Gfx = canvas.getGraphics(participant2),
|
|
|
|
sequenceFlow1 = elementRegistry.get('SequenceFlow_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
bendpointMove.start(canvasEvent(sequenceFlow1.waypoints[1]), sequenceFlow1, 1);
|
|
|
|
|
|
|
|
dragging.move(canvasEvent({ x: participant2.x + 100, y: participant2.y + 10 }));
|
|
|
|
dragging.hover({ element: participant2, gfx: participant2Gfx });
|
|
|
|
dragging.move(canvasEvent({ x: participant2.x + 105, y: participant2.y + 10 }));
|
|
|
|
|
|
|
|
|
|
|
|
var ctx = dragging.context();
|
|
|
|
var context = ctx.data.context;
|
|
|
|
|
|
|
|
var connectionPreview = context.getConnection(context.allowed);
|
|
|
|
|
|
|
|
var waypointsPreview = connectionPreview.waypoints.slice();
|
|
|
|
|
|
|
|
dragging.end();
|
|
|
|
|
|
|
|
var newWaypoints = participant2.incoming.slice(-1)[0].waypoints;
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(newWaypoints).to.exist;
|
|
|
|
expect(newWaypoints).to.deep.eql(waypointsPreview);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2019-05-27 08:24:28 +00:00
|
|
|
describe('attaching event', function() {
|
|
|
|
|
|
|
|
var diagramXML = require('test/spec/features/rules/BpmnRules.attaching.bpmn');
|
|
|
|
|
|
|
|
beforeEach(bootstrapModeler(diagramXML, {
|
2019-06-05 14:16:40 +00:00
|
|
|
modules: testModules
|
2019-05-27 08:24:28 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
it('should correctly lay out connection after replacement',
|
|
|
|
inject(function(elementRegistry, modeling) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var event = elementRegistry.get('IntermediateThrowEventWithConnections'),
|
|
|
|
parent = elementRegistry.get('SubProcess_1');
|
|
|
|
|
|
|
|
// when
|
|
|
|
modeling.moveElements([ event ], { x: 0, y: -90 }, parent, { attach: true });
|
|
|
|
|
|
|
|
// then
|
|
|
|
var boundaryEvent = elementRegistry.get('IntermediateThrowEventWithConnections');
|
|
|
|
|
|
|
|
expect(boundaryEvent.outgoing[0]).to.have.waypoints([
|
|
|
|
{ x: 769, y: 297 },
|
|
|
|
{ x: 769, y: 369 },
|
|
|
|
{ x: 837, y: 369 }
|
|
|
|
]);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
2019-04-18 12:22:21 +00:00
|
|
|
});
|
|
|
|
|
2015-07-15 15:22:19 +00:00
|
|
|
});
|
2017-12-10 11:29:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-27 08:57:22 +00:00
|
|
|
// helpers //////////////////////
|
2017-12-10 11:29:54 +00:00
|
|
|
|
|
|
|
function toPoint(p) {
|
|
|
|
return {
|
|
|
|
x: p.x,
|
|
|
|
y: p.y
|
|
|
|
};
|
2019-04-18 12:22:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function areOnSameAxis(a, b) {
|
|
|
|
return a.x === b.x || a.y === b.y;
|
2017-12-10 11:29:54 +00:00
|
|
|
}
|