2014-05-06 08:00:06 +00:00
|
|
|
'use strict';
|
|
|
|
|
2014-04-25 14:14:36 +00:00
|
|
|
var fs = require('fs');
|
|
|
|
|
2014-05-21 14:23:52 +00:00
|
|
|
var Viewer = require('../../../../../lib/Viewer');
|
2014-04-25 14:14:36 +00:00
|
|
|
|
2014-05-21 14:23:52 +00:00
|
|
|
var Matchers = require('../../../Matchers');
|
2014-04-25 14:14:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
describe('import - labels', function() {
|
|
|
|
|
|
|
|
beforeEach(Matchers.add);
|
|
|
|
|
|
|
|
var container;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
container = document.createElement('div');
|
|
|
|
document.getElementsByTagName('body')[0].appendChild(container);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2014-05-06 08:00:06 +00:00
|
|
|
describe('should import embedded labels', function() {
|
|
|
|
|
|
|
|
it('on flow nodes', function(done) {
|
2014-04-25 14:14:36 +00:00
|
|
|
|
2014-06-13 08:58:38 +00:00
|
|
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/embedded.bpmn', 'utf8');
|
2014-04-25 14:14:36 +00:00
|
|
|
|
2014-05-06 08:00:06 +00:00
|
|
|
var renderer = new Viewer(container);
|
2014-04-25 14:14:36 +00:00
|
|
|
|
2014-05-06 08:00:06 +00:00
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
2014-05-06 08:00:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
it('on pools and lanes', function(done) {
|
|
|
|
|
2014-06-13 08:58:38 +00:00
|
|
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/collaboration.bpmn', 'utf8');
|
2014-05-06 08:00:06 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe('should import external labels', function() {
|
|
|
|
|
|
|
|
it('with di', function(done) {
|
|
|
|
|
2014-06-13 08:58:38 +00:00
|
|
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external.bpmn', 'utf8');
|
2014-04-25 14:14:36 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('without di', function(done) {
|
|
|
|
|
2014-06-13 08:58:38 +00:00
|
|
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external-no-di.bpmn', 'utf8');
|
2014-04-25 14:14:36 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|