chore(core/ElementRegistry): pull API changes

Related to #153
This commit is contained in:
Nico Rehwaldt 2014-11-17 17:36:22 +01:00
parent b1f310a1db
commit 3a377a3871
15 changed files with 103 additions and 102 deletions

View File

@ -106,6 +106,7 @@ BpmnImporter.prototype.add = function(semantic, parentElement) {
this.addLabel(semantic, element);
}
this._eventBus.fire('bpmnElement.added', { element: element });
return element;
@ -183,5 +184,5 @@ BpmnImporter.prototype._getTarget = function(semantic) {
BpmnImporter.prototype._getElement = function(semantic) {
return this._elementRegistry.getById(semantic.id);
return this._elementRegistry.get(semantic.id);
};

View File

@ -104,7 +104,7 @@ describe('viewer', function() {
expect(elementRegistry).toBeDefined();
// given
var subProcessShape = elementRegistry.getById('SubProcess_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
// when
overlays.add('SubProcess_1', {

View File

@ -34,7 +34,7 @@ describe('features - label-editing', function() {
it('should register on dblclick', inject(function(elementRegistry, directEditing, eventBus) {
// given
var shape = elementRegistry.getById('task-nested-embedded');
var shape = elementRegistry.get('task-nested-embedded');
// when
eventBus.fire('shape.dblclick', { element: shape });
@ -47,7 +47,7 @@ describe('features - label-editing', function() {
it('should cancel on <ESC>', inject(function(elementRegistry, directEditing, eventBus) {
// given
var shape = elementRegistry.getById('task-nested-embedded'),
var shape = elementRegistry.get('task-nested-embedded'),
task = shape.businessObject;
var oldName = task.name;
@ -72,7 +72,7 @@ describe('features - label-editing', function() {
it('should submit on <canvas.click>', inject(function(elementRegistry, directEditing, eventBus) {
// given
var shape = elementRegistry.getById('task-nested-embedded'),
var shape = elementRegistry.get('task-nested-embedded'),
task = shape.businessObject;
// activate
@ -136,7 +136,7 @@ describe('features - label-editing', function() {
it('should update via command stack', function() {
// given
var diagramElement = elementRegistry.getById('user-task');
var diagramElement = elementRegistry.get('user-task');
var listenerCalled;
@ -156,7 +156,7 @@ describe('features - label-editing', function() {
it('should undo via command stack', inject(function(commandStack) {
// given
var diagramElement = elementRegistry.getById('user-task');
var diagramElement = elementRegistry.get('user-task');
var oldLabel = LabelUtil.getLabel(diagramElement);
@ -179,7 +179,7 @@ describe('features - label-editing', function() {
it('on shape change', function() {
// given
var diagramElement = elementRegistry.getById('user-task');
var diagramElement = elementRegistry.get('user-task');
var listenerCalled;
@ -201,7 +201,7 @@ describe('features - label-editing', function() {
it('on connection on change', function() {
// given
var diagramElement = elementRegistry.getById('sequence-flow-no');
var diagramElement = elementRegistry.get('sequence-flow-no');
var listenerCalled;
@ -228,7 +228,7 @@ describe('features - label-editing', function() {
return inject(function(elementRegistry, eventBus, directEditing) {
var diagramElement = elementRegistry.getById(elementId);
var diagramElement = elementRegistry.get(elementId);
var label = LabelUtil.getLabel(diagramElement);

View File

@ -33,7 +33,7 @@ describe('features/modeling - append shape', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var startEventShape = elementRegistry.get('StartEvent_1');
// when
var targetShape = modeling.appendFlowNode(startEventShape, 'bpmn:Task'),
@ -48,8 +48,8 @@ describe('features/modeling - append shape', function() {
it('should create DI', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -72,8 +72,8 @@ describe('features/modeling - append shape', function() {
it('should add to parent (sub process)', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -92,8 +92,8 @@ describe('features/modeling - append shape', function() {
it('correctly wired and positioned', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -106,7 +106,7 @@ describe('features/modeling - append shape', function() {
// then
expect(label).toBeDefined();
expect(elementRegistry.getById(label.id)).toBeDefined();
expect(elementRegistry.get(label.id)).toBeDefined();
expect(label.x).toBe(443);
expect(label.y).toBe(278);
@ -118,8 +118,8 @@ describe('features/modeling - append shape', function() {
it('with di', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -143,8 +143,8 @@ describe('features/modeling - append shape', function() {
it('should add connection', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -170,8 +170,8 @@ describe('features/modeling - append shape', function() {
it('should undo add to parent', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -191,8 +191,8 @@ describe('features/modeling - append shape', function() {
it('should undo add shape label', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -214,15 +214,15 @@ describe('features/modeling - append shape', function() {
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);
expect(targetShape.label).not.toBeDefined();
expect(elementRegistry.getById(target.id + '_label')).not.toBeDefined();
expect(elementRegistry.get(target.id + '_label')).not.toBeDefined();
}));
it('should undo add connection', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -247,15 +247,15 @@ describe('features/modeling - append shape', function() {
expect(connection.$parent).toBe(null);
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);
expect(elementRegistry.getById(targetShape.id)).not.toBeDefined();
expect(elementRegistry.get(targetShape.id)).not.toBeDefined();
}));
it('should undo add connection label', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -276,15 +276,15 @@ describe('features/modeling - append shape', function() {
expect(connection.$parent).toBe(null);
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);
expect(elementRegistry.getById(connection.id + '_label')).not.toBeDefined();
expect(elementRegistry.get(connection.id + '_label')).not.toBeDefined();
}));
it('should redo appending multiple shapes', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -310,15 +310,15 @@ describe('features/modeling - append shape', function() {
// then
expect(targetShape2.parent).toBe(null);
expect(elementRegistry.getById(targetShape2.id)).not.toBeDefined();
expect(elementRegistry.get(targetShape2.id)).not.toBeDefined();
}));
it('should redo add connection', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -353,7 +353,7 @@ describe('features/modeling - append shape', function() {
it('should wire connection source + target', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var startEventShape = elementRegistry.get('StartEvent_1');
// when
var targetShape = modeling.appendTextAnnotation(startEventShape, 'bpmn:TextAnnotation'),
@ -378,7 +378,7 @@ describe('features/modeling - append shape', function() {
it('should undo wire connection source + target', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var targetShape = modeling.appendTextAnnotation(startEventShape, 'bpmn:TextAnnotation'),
target = targetShape.businessObject;
@ -405,7 +405,7 @@ describe('features/modeling - append shape', function() {
it('should append', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var startEventShape = elementRegistry.get('StartEvent_1');
// when
var targetShape = modeling.appendFlowNode(startEventShape, 'bpmn:ExclusiveGateway'),
@ -420,8 +420,8 @@ describe('features/modeling - append shape', function() {
it('should add to parent (sub process)', inject(function(elementRegistry, modeling) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;
@ -438,8 +438,8 @@ describe('features/modeling - append shape', function() {
it('should undo append', inject(function(elementRegistry, modeling, commandStack) {
// given
var startEventShape = elementRegistry.getById('StartEvent_1');
var subProcessShape = elementRegistry.getById('SubProcess_1');
var startEventShape = elementRegistry.get('StartEvent_1');
var subProcessShape = elementRegistry.get('SubProcess_1');
var startEvent = startEventShape.businessObject,
subProcess = subProcessShape.businessObject;

View File

@ -30,9 +30,9 @@ describe('features/modeling - create connection', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject,
gatewayShape = elementRegistry.getById('Gateway_1'),
gatewayShape = elementRegistry.get('Gateway_1'),
gateway = gatewayShape.businessObject;
@ -81,9 +81,9 @@ describe('features/modeling - create connection', function() {
it('should undo', inject(function(elementRegistry, commandStack, modeling) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject,
gatewayShape = elementRegistry.getById('Gateway_1'),
gatewayShape = elementRegistry.get('Gateway_1'),
gateway = gatewayShape.businessObject;
@ -113,9 +113,9 @@ describe('features/modeling - create connection', function() {
it('should redo', inject(function(elementRegistry, commandStack, modeling) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject,
gatewayShape = elementRegistry.getById('Gateway_1'),
gatewayShape = elementRegistry.get('Gateway_1'),
gateway = gatewayShape.businessObject;

View File

@ -30,7 +30,7 @@ describe('features/modeling - #removeConnection', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var sequenceFlowShape = elementRegistry.getById('SequenceFlow_2'),
var sequenceFlowShape = elementRegistry.get('SequenceFlow_2'),
sequenceFlow = sequenceFlowShape.businessObject;
// when
@ -47,7 +47,7 @@ describe('features/modeling - #removeConnection', function() {
it('should undo', inject(function(elementRegistry, modeling, commandStack) {
// given
var sequenceFlowShape = elementRegistry.getById('SequenceFlow_2'),
var sequenceFlowShape = elementRegistry.get('SequenceFlow_2'),
sequenceFlow = sequenceFlowShape.businessObject,
parent = sequenceFlow.$parent;
@ -66,7 +66,7 @@ describe('features/modeling - #removeConnection', function() {
it('redo', inject(function(elementRegistry, modeling, commandStack) {
// given
var sequenceFlowShape = elementRegistry.getById('SequenceFlow_2'),
var sequenceFlowShape = elementRegistry.get('SequenceFlow_2'),
sequenceFlow = sequenceFlowShape.businessObject,
parent = sequenceFlow.$parent;

View File

@ -30,7 +30,7 @@ describe('features/modeling - #removeShape', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject;
// when
@ -47,7 +47,7 @@ describe('features/modeling - #removeShape', function() {
it('should undo', inject(function(elementRegistry, modeling, commandStack) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject,
parent = task.$parent;
@ -66,7 +66,7 @@ describe('features/modeling - #removeShape', function() {
it('redo', inject(function(elementRegistry, modeling, commandStack) {
// given
var taskShape = elementRegistry.getById('Task_1'),
var taskShape = elementRegistry.get('Task_1'),
task = taskShape.businessObject,
parent = task.$parent;

View File

@ -30,7 +30,7 @@ describe('features/modeling - layout connection', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
// when
@ -63,7 +63,7 @@ describe('features/modeling - layout connection', function() {
it('should undo', inject(function(elementRegistry, commandStack, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
var oldWaypoints = sequenceFlowConnection.waypoints,
@ -87,7 +87,7 @@ describe('features/modeling - layout connection', function() {
it('should redo', inject(function(elementRegistry, commandStack, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
modeling.layoutConnection(sequenceFlowConnection);

View File

@ -30,7 +30,7 @@ describe('features/modeling - move connection', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
// when
@ -63,7 +63,7 @@ describe('features/modeling - move connection', function() {
it('should undo', inject(function(elementRegistry, commandStack, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
var oldWaypoints = sequenceFlowConnection.waypoints,
@ -87,7 +87,7 @@ describe('features/modeling - move connection', function() {
it('should redo', inject(function(elementRegistry, commandStack, modeling) {
// given
var sequenceFlowConnection = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowConnection = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowConnection.businessObject;
modeling.moveConnection(sequenceFlowConnection, { x: 20, y: 10 });

View File

@ -30,10 +30,10 @@ describe('features/modeling - move shape', function() {
it('should execute', inject(function(elementRegistry, modeling) {
// given
var startEventElement = elementRegistry.getById('StartEvent_1'),
var startEventElement = elementRegistry.get('StartEvent_1'),
startEvent = startEventElement.businessObject;
var sequenceFlowElement = elementRegistry.getById('SequenceFlow_1'),
var sequenceFlowElement = elementRegistry.get('SequenceFlow_1'),
sequenceFlow = sequenceFlowElement.businessObject;
var oldPosition = {
@ -68,7 +68,7 @@ describe('features/modeling - move shape', function() {
it('should execute on label', inject(function(elementRegistry, modeling) {
// given
var labelElement = elementRegistry.getById('StartEvent_1_label'),
var labelElement = elementRegistry.get('StartEvent_1_label'),
startEvent = labelElement.businessObject;
var oldPosition = {
@ -88,7 +88,7 @@ describe('features/modeling - move shape', function() {
it('should move label with element', inject(function(elementRegistry, modeling) {
// given
var startEventElement = elementRegistry.getById('StartEvent_1'),
var startEventElement = elementRegistry.get('StartEvent_1'),
startEvent = startEventElement.businessObject;
var label = startEventElement.label;
@ -114,7 +114,7 @@ describe('features/modeling - move shape', function() {
it('should undo', inject(function(elementRegistry, commandStack, modeling) {
// given
var startEventElement = elementRegistry.getById('StartEvent_1'),
var startEventElement = elementRegistry.get('StartEvent_1'),
startEvent = startEventElement.businessObject;
var oldPosition = {
@ -136,7 +136,7 @@ describe('features/modeling - move shape', function() {
it('should undo on label', inject(function(elementRegistry, commandStack, modeling) {
// given
var labelElement = elementRegistry.getById('StartEvent_1_label'),
var labelElement = elementRegistry.get('StartEvent_1_label'),
startEvent = labelElement.businessObject;
var oldPosition = {
@ -162,7 +162,7 @@ describe('features/modeling - move shape', function() {
it('should redo', inject(function(elementRegistry, commandStack, modeling) {
// given
var startEventElement = elementRegistry.getById('StartEvent_1'),
var startEventElement = elementRegistry.get('StartEvent_1'),
startEvent = startEventElement.businessObject;
@ -186,7 +186,7 @@ describe('features/modeling - move shape', function() {
it('should redo on label', inject(function(elementRegistry, commandStack, modeling) {
// given
var labelElement = elementRegistry.getById('StartEvent_1_label'),
var labelElement = elementRegistry.get('StartEvent_1_label'),
startEvent = labelElement.businessObject;
modeling.moveShape(labelElement, { x: 0, y: 50 });

View File

@ -268,7 +268,7 @@ describe('import - importer', function() {
var elementRegistry = diagram.get('elementRegistry');
var element = elementRegistry.getById('GATEWAY_1');
var element = elementRegistry.get('GATEWAY_1');
expect(element.businessObject.eventGatewayType).toEqual('Exclusive');

View File

@ -28,7 +28,7 @@ describe('import - associations', function() {
// when
inject(function(elementRegistry) {
var association = elementRegistry.getById('Association_1');
var association = elementRegistry.get('Association_1');
// then
expect(association).toBeDefined();
@ -54,7 +54,7 @@ describe('import - associations', function() {
// when
inject(function(elementRegistry) {
var association = elementRegistry.getById('Association_1');
var association = elementRegistry.get('Association_1');
// then
expect(association).toBeDefined();
@ -84,8 +84,8 @@ describe('import - associations', function() {
// when
inject(function(elementRegistry) {
var dataInputAssociation = elementRegistry.getById('DataInputAssociation_1');
var dataOutputAssociation = elementRegistry.getById('DataOutputAssociation_1');
var dataInputAssociation = elementRegistry.get('DataInputAssociation_1');
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
// then
expect(dataInputAssociation).toBeDefined();
@ -112,8 +112,8 @@ describe('import - associations', function() {
// when
inject(function(elementRegistry) {
var dataInputAssociation = elementRegistry.getById('DataInputAssociation_1');
var dataOutputAssociation = elementRegistry.getById('DataOutputAssociation_1');
var dataInputAssociation = elementRegistry.get('DataInputAssociation_1');
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
// then
expect(dataInputAssociation).toBeDefined();

View File

@ -22,8 +22,8 @@ describe('import - collapsed container', function() {
it('should import collapsed subProcess', inject(function(elementRegistry) {
var collapsedShape = elementRegistry.getById('SubProcess_1');
var childShape = elementRegistry.getById('IntermediateCatchEvent_1');
var collapsedShape = elementRegistry.get('SubProcess_1');
var childShape = elementRegistry.get('IntermediateCatchEvent_1');
expect(collapsedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -31,8 +31,8 @@ describe('import - collapsed container', function() {
it('should import collapsed transaction', inject(function(elementRegistry) {
var collapsedShape = elementRegistry.getById('Transaction_1');
var childShape = elementRegistry.getById('UserTask_1');
var collapsedShape = elementRegistry.get('Transaction_1');
var childShape = elementRegistry.get('UserTask_1');
expect(collapsedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -40,8 +40,8 @@ describe('import - collapsed container', function() {
it('should import collapsed adhocSubProcess', inject(function(elementRegistry) {
var collapsedShape = elementRegistry.getById('AdHocSubProcess_1');
var childShape = elementRegistry.getById('StartEvent_1');
var collapsedShape = elementRegistry.get('AdHocSubProcess_1');
var childShape = elementRegistry.get('StartEvent_1');
expect(collapsedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -49,9 +49,9 @@ describe('import - collapsed container', function() {
it('should import collapsed with nested elements', inject(function(elementRegistry) {
var collapsedShape = elementRegistry.getById('SubProcess_4');
var childShape = elementRegistry.getById('SubProcess_5');
var nestedChildShape = elementRegistry.getById('Task_3');
var collapsedShape = elementRegistry.get('SubProcess_4');
var childShape = elementRegistry.get('SubProcess_5');
var nestedChildShape = elementRegistry.get('Task_3');
expect(collapsedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -60,17 +60,17 @@ describe('import - collapsed container', function() {
it('should import collapsed with nested elements', inject(function(elementRegistry) {
var hiddenEventShape = elementRegistry.getById('StartEvent_2');
var hiddenEventShape = elementRegistry.get('StartEvent_2');
expect(hiddenEventShape.label.hidden).toBe(true);
var hiddenDataShape = elementRegistry.getById('DataObjectReference_1');
var hiddenDataShape = elementRegistry.get('DataObjectReference_1');
expect(hiddenDataShape.label.hidden).toBe(true);
}));
it('should import expanded subProcess', inject(function(elementRegistry) {
var expandedShape = elementRegistry.getById('SubProcess_3');
var childShape = elementRegistry.getById('Task_2');
var expandedShape = elementRegistry.get('SubProcess_3');
var childShape = elementRegistry.get('Task_2');
expect(expandedShape.collapsed).toBe(false);
expect(childShape.hidden).toBe(false);
@ -87,8 +87,8 @@ describe('import - collapsed container', function() {
it('should import collapsed subProcess in pool', inject(function(elementRegistry) {
var expandedShape = elementRegistry.getById('SubProcess_1');
var childShape = elementRegistry.getById('Task_1');
var expandedShape = elementRegistry.get('SubProcess_1');
var childShape = elementRegistry.get('Task_1');
expect(expandedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -96,8 +96,8 @@ describe('import - collapsed container', function() {
it('should import expanded subProcess in pool', inject(function(elementRegistry) {
var expandedShape = elementRegistry.getById('SubProcess_2');
var childShape = elementRegistry.getById('StartEvent_1');
var expandedShape = elementRegistry.get('SubProcess_2');
var childShape = elementRegistry.get('StartEvent_1');
expect(expandedShape.collapsed).toBe(false);
expect(childShape.hidden).toBe(false);
@ -105,8 +105,8 @@ describe('import - collapsed container', function() {
it('should import collapsed subProcess in lane', inject(function(elementRegistry) {
var expandedShape = elementRegistry.getById('SubProcess_4');
var childShape = elementRegistry.getById('Task_2');
var expandedShape = elementRegistry.get('SubProcess_4');
var childShape = elementRegistry.get('Task_2');
expect(expandedShape.collapsed).toBe(true);
expect(childShape.hidden).toBe(true);
@ -114,8 +114,8 @@ describe('import - collapsed container', function() {
it('should import expanded subProcess in lane', inject(function(elementRegistry) {
var expandedShape = elementRegistry.getById('SubProcess_3');
var childShape = elementRegistry.getById('StartEvent_2');
var expandedShape = elementRegistry.get('SubProcess_3');
var childShape = elementRegistry.get('StartEvent_2');
expect(expandedShape.collapsed).toBe(false);
expect(childShape.hidden).toBe(false);

View File

@ -55,8 +55,8 @@ describe('import - labels', function() {
// when
inject(function(elementRegistry) {
var endEvent = elementRegistry.getById('EndEvent_1'),
sequenceFlow = elementRegistry.getById('SequenceFlow_1');
var endEvent = elementRegistry.get('EndEvent_1'),
sequenceFlow = elementRegistry.get('SequenceFlow_1');
// then
expect(bounds(endEvent.label)).toEqual({ x: 211, y: 256, width: 119, height: 44 });