From 6ae4c3d0c3c9352406471af1abf967f6e0e75c94 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 26 Jul 2016 10:53:45 +0200 Subject: [PATCH] test(import): verify duplicate id behavior --- test/fixtures/bpmn/error/duplicate-ids.bpmn | 15 +++++++++++++++ test/spec/ViewerSpec.js | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/fixtures/bpmn/error/duplicate-ids.bpmn diff --git a/test/fixtures/bpmn/error/duplicate-ids.bpmn b/test/fixtures/bpmn/error/duplicate-ids.bpmn new file mode 100644 index 00000000..5454ae02 --- /dev/null +++ b/test/fixtures/bpmn/error/duplicate-ids.bpmn @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test/spec/ViewerSpec.js b/test/spec/ViewerSpec.js index 7f28cb10..f799cea9 100644 --- a/test/spec/ViewerSpec.js +++ b/test/spec/ViewerSpec.js @@ -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 / + ]); + + done(); + }); + }); + });