test(Viewer): verify non-args #open

This commit is contained in:
Nico Rehwaldt 2019-04-12 13:05:59 +02:00 committed by Nico Rehwaldt
parent b1ee678fe3
commit 2f99cff34a
1 changed files with 26 additions and 0 deletions

View File

@ -804,6 +804,32 @@ describe('Viewer', function() {
});
it('should open the first diagram if id was not provided', function(done) {
// given
var firstDiagramId = 'Diagram_35ab9b1f-354a-48cb-9b99-f4e448f7b04c';
// when
createViewer(xml, firstDiagramId, function(err, warnings, viewer) {
// then
var renderedDiagram = viewer.get('canvas').getRootElement().businessObject.di;
viewer.open(function(err) {
if (err) {
return done(err);
}
// then
expect(viewer.get('canvas').getRootElement().businessObject.di).to.equal(renderedDiagram);
done();
});
});
});
it('should complete with error if xml was not imported', function(done) {
// given