Skip to content

Commit

Permalink
fix(client): fix initial diagram coordinates
Browse files Browse the repository at this point in the history
closes #4488
  • Loading branch information
misiekhardcore authored and philippfromme committed Oct 29, 2024
1 parent 8d195a4 commit 4e1538f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
12 changes: 12 additions & 0 deletions client/src/app/tabs/bpmn/__tests__/DiagramSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ describe('tabs/bpmn', function() {
expect(contents).to.contain('historyTimeToLive="{{ DEFAULT_HTTL }}');
});


it('should have initial start event snapped to grid', function() {

// when
const contents = require('../diagram.bpmn');

// then
expect(contents).to.match(
/<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">\s+<dc:Bounds x="182" y="162" width="36" height="36" \/>\s+<\/bpmndi:BPMNShape>/
);
});

});

});
4 changes: 2 additions & 2 deletions client/src/app/tabs/bpmn/diagram.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_{{ ID:process }}">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
<dc:Bounds x="182" y="162" width="36" height="36" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
Expand Down
39 changes: 39 additions & 0 deletions client/src/app/tabs/cloud-bpmn/__tests__/DiagramSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
*
* Camunda licenses this file to you under the MIT; you may not use this file
* except in compliance with the MIT License.
*/

describe('tabs/cloud-bpmn', function() {

describe('initial diagram', function() {

it('should contain placeholders', function() {

// when
const contents = require('../diagram.bpmn');

// then
expect(contents).to.contain('id="Definitions_{{ ID }}"');
expect(contents).to.contain('id="Process_{{ ID:process }}"');
});


it('should have initial start event snapped to grid', function() {

// when
const contents = require('../diagram.bpmn');

// then
expect(contents).to.match(
/<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">\s+<dc:Bounds x="182" y="162" width="36" height="36" \/>\s+<\/bpmndi:BPMNShape>/
);
});

});

});
4 changes: 2 additions & 2 deletions client/src/app/tabs/cloud-bpmn/diagram.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_{{ ID:process }}">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
<dc:Bounds x="182" y="162" width="36" height="36" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
Expand Down

0 comments on commit 4e1538f

Please sign in to comment.