test(import): verify duplicate id behavior

This commit is contained in:
Nico Rehwaldt 2016-07-26 10:53:45 +02:00
parent 1531b32e90
commit 6ae4c3d0c3
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
id="definitions"
targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn2:process id="test" />
<bpmn2:process id="test" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="test">
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

View File

@ -230,6 +230,25 @@ describe('Viewer', function() {
}); });
}); });
it('should handle duplicate ids', function(done) {
var xml = require('../fixtures/bpmn/error/duplicate-ids.bpmn');
// when
createViewer(xml, function(err, warnings) {
// then
expect(err).not.to.exist;
expectWarnings(warnings, [
/duplicate ID <test>/
]);
done();
});
});
}); });