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-09 13:20:29 +00:00
|
|
|
|
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-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
|
|
|
});
|