2014-04-25 11:31:18 +00:00
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
var Viewer = require('../../../../lib/Viewer');
|
|
|
|
|
|
|
|
var Matchers = require('../../Matchers');
|
|
|
|
|
|
|
|
|
|
|
|
describe('draw/BpmnRenderer', function() {
|
|
|
|
|
|
|
|
beforeEach(Matchers.add);
|
|
|
|
|
|
|
|
var container;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
container = document.createElement('div');
|
|
|
|
document.getElementsByTagName('body')[0].appendChild(container);
|
|
|
|
});
|
|
|
|
|
2014-05-21 11:51:59 +00:00
|
|
|
it('should render message flow message marker', function(done) {
|
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/message-marker.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-18 10:20:11 +00:00
|
|
|
it('should render pool collection marker', function(done) {
|
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/pools-with-collection-marker.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
2014-05-19 14:22:55 +00:00
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render conditional default flows', function(done) {
|
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/conditional-default-flow.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
2014-05-18 10:20:11 +00:00
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-16 12:45:48 +00:00
|
|
|
it('should render conditional flows', function(done) {
|
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/conditional-flow.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-02 09:17:25 +00:00
|
|
|
it('should render text annotations', function(done) {
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/text-annotation.bpmn', 'utf8');
|
2014-05-02 09:17:25 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-12 09:48:24 +00:00
|
|
|
it('should render task types', function(done) {
|
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/task-types.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render activity marker', function(done) {
|
2014-05-05 15:22:43 +00:00
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/activity-marker-combination.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-12 09:48:24 +00:00
|
|
|
it('should render activity marker', function(done) {
|
2014-05-05 15:22:43 +00:00
|
|
|
|
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/activity-marker.bpmn', 'utf8');
|
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
it('should render data objects', function(done) {
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/data-objects.bpmn', 'utf8');
|
2014-05-02 06:25:08 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
2014-04-25 11:31:18 +00:00
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-04-25 11:31:18 +00:00
|
|
|
it('should render events', function(done) {
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/events.bpmn', 'utf8');
|
2014-04-25 11:31:18 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
it('should render events (interrupting)', function(done) {
|
2014-04-25 11:31:18 +00:00
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/events-interrupting.bpmn', 'utf8');
|
2014-04-30 14:36:02 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
it('should render gateways', function(done) {
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/gateways.bpmn', 'utf8');
|
2014-04-30 14:36:02 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
it('should render groups', function(done) {
|
2014-04-25 11:31:18 +00:00
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/group.bpmn', 'utf8');
|
2014-04-25 11:31:18 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-05-02 06:25:08 +00:00
|
|
|
it('should render pools', function(done) {
|
|
|
|
|
2014-05-09 13:20:29 +00:00
|
|
|
var xml = fs.readFileSync(__dirname + '/../../../fixtures/bpmn/render/pools.bpmn', 'utf8');
|
2014-05-02 06:25:08 +00:00
|
|
|
|
|
|
|
var renderer = new Viewer(container);
|
|
|
|
|
|
|
|
renderer.importXML(xml, function(err) {
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
2014-05-09 13:20:29 +00:00
|
|
|
|
2014-04-25 11:31:18 +00:00
|
|
|
});
|