test(modeling): verify missing bpmndi:BPMNLabel update behavior

This commit is contained in:
Nico Rehwaldt 2018-05-16 13:12:18 +02:00 committed by Philipp Fromme
parent b98dd6fe95
commit 0f62183410
2 changed files with 30 additions and 5 deletions

View File

@ -2,13 +2,17 @@
<semantic:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:semantic="http://www.omg.org/spec/BPMN/20100524/MODEL" id="Definitions" targetNamespace="http://bpmn.io/schema/bpmn">
<semantic:process id="Process">
<semantic:startEvent id="StartEvent" />
<semantic:startEvent id="StartEvent_2" name="Start" />
</semantic:process>
<bpmndi:BPMNDiagram id="Trisotech.Visio-_6" name="Untitled Diagram" documentation="" resolution="96.00000267028808">
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane bpmnElement="Process">
<bpmndi:BPMNShape id="StartEvent_di" bpmnElement="StartEvent">
<dc:Bounds x="192" y="123" width="36" height="36" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_2_di" bpmnElement="StartEvent_2">
<dc:Bounds x="306" y="123" width="36" height="36" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</semantic:definitions>

View File

@ -89,16 +89,16 @@ describe('features - bpmn-updater', function() {
});
describe('missing bpmndi:Bounds', function() {
describe('incomplete DI', function() {
var diagramXML = require('./BpmnUpdater.missingBounds.bpmn');
var diagramXML = require('./BpmnUpdater.incompleteDi.bpmn');
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));
it('should add bpmndi:Bounds', inject(
it('should add missing label bpmndi:Bounds', inject(
function(modeling, elementRegistry) {
// given
@ -121,6 +121,27 @@ describe('features - bpmn-updater', function() {
}
));
it('should add missing bpmndi:BPMNLabel', inject(
function(modeling, elementRegistry) {
// given
var event = elementRegistry.get('StartEvent_2'),
label = event.label,
di = event.businessObject.di;
// when
modeling.moveElements([ label ], { x: 20, y: 20 });
var diLabel = di.label;
// then
expect(diLabel).to.exist;
expect(diLabel.bounds).to.exist;
}
));
});
});