test(import): verify duplicate DI import behavior

This commit is contained in:
Nico Rehwaldt 2019-04-12 13:42:29 +02:00 committed by Nico Rehwaldt
parent ba987734f8
commit 7b03e5289a
2 changed files with 34 additions and 3 deletions

View File

@ -95,7 +95,7 @@ describe('Modeler', function() {
modeler.importXML(xml, function(err, warnings) {
// then
expect(warnings.length).to.equal(0);
expect(warnings).to.be.empty;
done();
});
@ -104,6 +104,35 @@ describe('Modeler', function() {
});
it('should switch between diagrams', function(done) {
var multipleXML = require('../fixtures/bpmn/multiple-diagrams.bpmn');
// given
createModeler(multipleXML, function(err, warnings, modeler) {
if (err) {
return done(err);
}
// when
modeler.open('Diagram_2', function(err, warnings) {
if (err) {
return done(err);
}
// then
expect(warnings).to.be.empty;
done();
});
});
});
describe('translate support', function() {
var xml = require('../fixtures/bpmn/simple.bpmn');

View File

@ -804,7 +804,7 @@ describe('Viewer', function() {
it('should switch between diagrams', function(done) {
// when
createViewer(multipleXML, 'Diagram_2', function(err, warnings, viewer) {
createViewer(multipleXML, 'Diagram_1', function(err, warnings, viewer) {
// then
expect(err).not.to.exist;
@ -815,7 +815,7 @@ describe('Viewer', function() {
expect(definitions).to.exist;
viewer.open('Diagram_4', function(err, warnings) {
viewer.open('Diagram_2', function(err, warnings) {
// then
expect(err).not.to.exist;
@ -825,7 +825,9 @@ describe('Viewer', function() {
done();
});
});
});