Skip to content

Commit

Permalink
fix(label-layouting): fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jan 6, 2021
1 parent 16ade3b commit 310157c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 83 deletions.
30 changes: 30 additions & 0 deletions test/spec/features/modeling/LabelLayouting.integration.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:signavio="http://www.signavio.com" id="sid-d5a68e61-ca67-438f-971d-6843c39b383e" targetNamespace="http://www.signavio.com/bpmn20" exporter="Camunda Modeler" exporterVersion="4.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd">
<dataStore id="sid-1f3b3b35-28a1-4fff-8835-ae271ef486d5" name="HR-Tool" capacity="0" isUnlimited="false" />
<process id="Process_1" isExecutable="false">
<startEvent id="Event_1">
<outgoing>Flow_1</outgoing>
</startEvent>
<endEvent id="Event_2">
<incoming>Flow_1</incoming>
</endEvent>
<sequenceFlow id="Flow_1" name="foo" sourceRef="Event_1" targetRef="Event_2" />
</process>
<bpmndi:BPMNDiagram id="sid-780f0a66-41b5-4f10-a81d-35e00c8c284d">
<bpmndi:BPMNPlane id="sid-1780a274-6bf1-44a0-9a08-01bd7c9ad080" bpmnElement="Process_1">
<bpmndi:BPMNEdge id="Flow_1ewg7cg_di" bpmnElement="Flow_1">
<di:waypoint x="118" y="100" />
<di:waypoint x="382" y="109" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="242" y="87" width="16" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_1j8xw70_di" bpmnElement="Event_1">
<omgdc:Bounds x="82" y="82" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_080mc73_di" bpmnElement="Event_2">
<omgdc:Bounds x="382" y="92" width="36" height="36" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
76 changes: 0 additions & 76 deletions test/spec/features/modeling/LabelLayouting.special.bpmn

This file was deleted.

13 changes: 6 additions & 7 deletions test/spec/features/modeling/LabelLayoutingSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ describe('modeling - label layouting', function() {

describe('on bendpoint add/delete/moving', function() {


it('move, label on segment', inject(function(elementRegistry, bendpointMove, dragging) {

// given
Expand Down Expand Up @@ -521,7 +520,7 @@ describe('modeling - label layouting', function() {

describe('space tool', function() {

var diagramXML = require('./LabelLayouting.special.bpmn');
var diagramXML = require('./LabelLayouting.integration.bpmn');

beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
Expand All @@ -532,20 +531,20 @@ describe('modeling - label layouting', function() {
}));


it('should NOT adjust / move with a skewed line', inject(function(elementRegistry, spaceTool, dragging) {
it('should adjust (diagonal sequence flow)', inject(function(elementRegistry, spaceTool, dragging) {

// given
var connection = elementRegistry.get('SequenceFlow_1'),
var connection = elementRegistry.get('Flow_1'),
labelPosition = getLabelPosition(connection);

// when
spaceTool.activateMakeSpace(canvasEvent({ x: 500, y: 225 }));
spaceTool.activateMakeSpace(canvasEvent({ x: 200, y: 0 }));

dragging.move(canvasEvent({ x: 550, y: 225 }));
dragging.move(canvasEvent({ x: 300, y: 0 }));
dragging.end();

// then
expectLabelMoved(connection, labelPosition, { x: 0, y: 0 });
expectLabelMoved(connection, labelPosition, { x: 141, y: 5 });
}));

});
Expand Down

0 comments on commit 310157c

Please sign in to comment.