mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-23 14:18:10 +00:00
test(Viewer): expect no warnings when DIs use same elements
This commit is contained in:
parent
a7c0bb8f57
commit
87c1d2d142
46
test/fixtures/bpmn/multiple-diagrams-simple.bpmn
vendored
Normal file
46
test/fixtures/bpmn/multiple-diagrams-simple.bpmn
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<?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:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="3.3.1">
|
||||
<process id="Process_1" isExecutable="false">
|
||||
<task id="Task_A" name="A">
|
||||
<outgoing>SequenceFlow</outgoing>
|
||||
</task>
|
||||
<endEvent id="EndEvent_B" name="B">
|
||||
<incoming>SequenceFlow</incoming>
|
||||
</endEvent>
|
||||
<sequenceFlow id="SequenceFlow" sourceRef="Task_A" targetRef="EndEvent_B" />
|
||||
</process>
|
||||
<bpmndi:BPMNDiagram id="BpmnDiagram_1">
|
||||
<bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
|
||||
<bpmndi:BPMNShape id="BpmnDiagram_1_Task_A_di" bpmnElement="Task_A">
|
||||
<omgdc:Bounds x="156" y="81" width="100" height="80" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="BpmnDiagram_1_EndEvent_B_di" bpmnElement="EndEvent_B">
|
||||
<omgdc:Bounds x="306" y="103" width="36" height="36" />
|
||||
<bpmndi:BPMNLabel>
|
||||
<omgdc:Bounds x="320" y="147" width="8" height="14" />
|
||||
</bpmndi:BPMNLabel>
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNEdge id="BpmnDiagram_1_SequenceFlow_di" bpmnElement="SequenceFlow">
|
||||
<omgdi:waypoint x="256" y="121" />
|
||||
<omgdi:waypoint x="306" y="121" />
|
||||
</bpmndi:BPMNEdge>
|
||||
</bpmndi:BPMNPlane>
|
||||
</bpmndi:BPMNDiagram>
|
||||
<bpmndi:BPMNDiagram id="BpmnDiagram_2">
|
||||
<bpmndi:BPMNPlane id="BpmnPlane_2" bpmnElement="Process_1">
|
||||
<bpmndi:BPMNShape id="BpmnDiagram_2_Task_A_di" bpmnElement="Task_A">
|
||||
<omgdc:Bounds x="156" y="81" width="100" height="80" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="BpmnDiagram_2_EndEvent_B_di" bpmnElement="EndEvent_B">
|
||||
<omgdc:Bounds x="306" y="103" width="36" height="36" />
|
||||
<bpmndi:BPMNLabel>
|
||||
<omgdc:Bounds x="320" y="147" width="8" height="14" />
|
||||
</bpmndi:BPMNLabel>
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNEdge id="BpmnDiagram_2_SequenceFlow_di" bpmnElement="SequenceFlow">
|
||||
<omgdi:waypoint x="256" y="121" />
|
||||
<omgdi:waypoint x="306" y="121" />
|
||||
</bpmndi:BPMNEdge>
|
||||
</bpmndi:BPMNPlane>
|
||||
</bpmndi:BPMNDiagram>
|
||||
</definitions>
|
@ -771,7 +771,8 @@ describe('Viewer', function() {
|
||||
|
||||
describe('#open', function() {
|
||||
|
||||
var multipleXML = require('../fixtures/bpmn/multiple-diagrams.bpmn');
|
||||
var multipleXML = require('../fixtures/bpmn/multiple-diagrams.bpmn'),
|
||||
simpleMultipleXML = require('../fixtures/bpmn/multiple-diagrams-simple.bpmn');
|
||||
|
||||
|
||||
it('should open the first diagram if id was not provided', function(done) {
|
||||
@ -833,6 +834,36 @@ describe('Viewer', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should switch between diagrams with overlapping DI', function(done) {
|
||||
|
||||
// when
|
||||
createViewer(simpleMultipleXML, 'BpmnDiagram_1', function(err, warnings, viewer) {
|
||||
|
||||
// then
|
||||
expect(err).not.to.exist;
|
||||
|
||||
expect(warnings).to.be.empty;
|
||||
|
||||
var definitions = viewer.getDefinitions();
|
||||
|
||||
expect(definitions).to.exist;
|
||||
|
||||
viewer.open('BpmnDiagram_2', function(err, warnings) {
|
||||
|
||||
// then
|
||||
expect(err).not.to.exist;
|
||||
expect(warnings).to.be.empty;
|
||||
|
||||
expect(definitions).to.equal(viewer.getDefinitions());
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
it('should complete with error if xml was not imported', function(done) {
|
||||
|
||||
// given
|
||||
|
Loading…
x
Reference in New Issue
Block a user