Skip to content

Commit 6cf4cdb

Browse files
committed
add test case for supposedly removed association on type change
1 parent 102f21d commit 6cf4cdb

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { bootstrapModeler, inject } from 'test/TestHelper';
2+
3+
import coreModule from 'lib/core';
4+
import modelingModule from 'lib/features/modeling';
5+
6+
describe('features/modeling - change subprocess type', function () {
7+
var testModules = [coreModule, modelingModule];
8+
9+
var processDiagramXML = require('./RemoveTodo.bpmn');
10+
11+
beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules }));
12+
13+
var subprocessShape, taskShape;
14+
15+
beforeEach(inject(function (elementRegistry) {
16+
subprocessShape = elementRegistry.get('Subprocess');
17+
taskShape = elementRegistry.get('Task');
18+
}));
19+
20+
describe('change activity type', function () {
21+
it('should execute', inject(function (
22+
bpmnReplace,
23+
elementRegistry
24+
) {
25+
26+
// when
27+
bpmnReplace.replaceElement(subprocessShape, {
28+
type: 'bpmn:AdHocSubProcess',
29+
});
30+
taskShape = elementRegistry.get('Task');
31+
32+
// then
33+
expect(taskShape.businessObject.dataOutputAssociations).to.not.be.empty;
34+
}));
35+
});
36+
});
37+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:color="http://www.omg.org/spec/BPMN/non-normative/color/1.0" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="0.7.0-dev">
3+
<bpmn:process id="Process_1" isExecutable="false">
4+
<bpmn:dataStoreReference id="DataStoreReference" />
5+
<bpmn:dataObjectReference id="DataObjectReference" dataObjectRef="DataObject" />
6+
<bpmn:dataObject id="DataObject" />
7+
<bpmn:subProcess id="Subprocess">
8+
<bpmn:task id="Task">
9+
<bpmn:dataOutputAssociation id="DataStoreOutputAssociation">
10+
<bpmn:targetRef>DataStoreReference</bpmn:targetRef>
11+
</bpmn:dataOutputAssociation>
12+
<bpmn:dataOutputAssociation id="DataObjectOutputAssociation">
13+
<bpmn:targetRef>DataObjectReference</bpmn:targetRef>
14+
</bpmn:dataOutputAssociation>
15+
</bpmn:task>
16+
</bpmn:subProcess>
17+
</bpmn:process>
18+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
19+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
20+
<bpmndi:BPMNShape id="DataStoreReference_di" bpmnElement="DataStoreReference">
21+
<dc:Bounds x="555" y="565" width="50" height="50" />
22+
</bpmndi:BPMNShape>
23+
<bpmndi:BPMNShape id="DataObjectReference_di" bpmnElement="DataObjectReference">
24+
<dc:Bounds x="742" y="555" width="36" height="50" />
25+
</bpmndi:BPMNShape>
26+
<bpmndi:BPMNShape id="Subprocess_di" bpmnElement="Subprocess" isExpanded="true">
27+
<dc:Bounds x="450" y="260" width="350" height="200" />
28+
</bpmndi:BPMNShape>
29+
<bpmndi:BPMNShape id="Task_di" bpmnElement="Task">
30+
<dc:Bounds x="540" y="320" width="100" height="80" />
31+
</bpmndi:BPMNShape>
32+
<bpmndi:BPMNEdge id="DataStoreOutputAssociation_di" bpmnElement="DataStoreOutputAssociation">
33+
<di:waypoint x="587" y="400" />
34+
<di:waypoint x="580" y="565" />
35+
</bpmndi:BPMNEdge>
36+
<bpmndi:BPMNEdge id="DataObjectOutputAssociation_di" bpmnElement="DataObjectOutputAssociation">
37+
<di:waypoint x="621" y="400" />
38+
<di:waypoint x="742" y="557" />
39+
</bpmndi:BPMNEdge>
40+
</bpmndi:BPMNPlane>
41+
</bpmndi:BPMNDiagram>
42+
</bpmn:definitions>

0 commit comments

Comments
 (0)