2014-05-06 08:00:06 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-06-07 06:46:45 +00:00
|
|
|
require('../../../TestHelper');
|
2014-06-18 09:45:30 +00:00
|
|
|
|
2014-08-05 06:17:22 +00:00
|
|
|
/* global bootstrapViewer, inject */
|
2014-04-25 14:14:36 +00:00
|
|
|
|
|
|
|
|
2014-10-30 11:07:28 +00:00
|
|
|
describe('import - labels', function() {
|
2014-04-25 14:14:36 +00:00
|
|
|
|
2014-05-06 08:00:06 +00:00
|
|
|
describe('should import embedded labels', function() {
|
|
|
|
|
|
|
|
it('on flow nodes', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/labels/embedded.bpmn');
|
2014-08-05 06:17:22 +00:00
|
|
|
bootstrapViewer(xml)(done);
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
2014-05-06 08:00:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
it('on pools and lanes', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/labels/collaboration.bpmn');
|
2014-08-05 06:17:22 +00:00
|
|
|
bootstrapViewer(xml)(done);
|
2014-05-06 08:00:06 +00:00
|
|
|
});
|
|
|
|
|
2014-06-17 09:03:03 +00:00
|
|
|
|
|
|
|
it('on message flows', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/labels/collaboration-message-flows.bpmn');
|
2014-08-05 06:17:22 +00:00
|
|
|
bootstrapViewer(xml)(done);
|
2014-06-17 09:03:03 +00:00
|
|
|
});
|
|
|
|
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe('should import external labels', function() {
|
|
|
|
|
|
|
|
it('with di', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/labels/external.bpmn');
|
2014-10-30 11:07:28 +00:00
|
|
|
|
|
|
|
// given
|
|
|
|
bootstrapViewer(xml)(function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
return done(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// when
|
|
|
|
inject(function(elementRegistry) {
|
|
|
|
|
2014-11-17 16:36:22 +00:00
|
|
|
var endEvent = elementRegistry.get('EndEvent_1'),
|
|
|
|
sequenceFlow = elementRegistry.get('SequenceFlow_1');
|
2014-10-30 11:07:28 +00:00
|
|
|
|
|
|
|
// then
|
2016-09-01 16:01:04 +00:00
|
|
|
expect(endEvent.label.x).to.be.within(236, 237);
|
|
|
|
expect(endEvent.label.y).to.be.within(256, 256);
|
|
|
|
expect(endEvent.label.width).to.be.within(68, 69);
|
|
|
|
expect(endEvent.label.height).to.be.within(25, 30);
|
|
|
|
|
|
|
|
expect(sequenceFlow.label.x).to.be.within(441, 442);
|
|
|
|
expect(sequenceFlow.label.y).to.be.within(316, 317);
|
|
|
|
expect(sequenceFlow.label.width).to.be.within(79, 82);
|
|
|
|
expect(sequenceFlow.label.height).to.be.within(13, 15);
|
2014-10-30 11:07:28 +00:00
|
|
|
|
|
|
|
done();
|
|
|
|
})();
|
|
|
|
|
|
|
|
});
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('without di', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../../../fixtures/bpmn/import/labels/external-no-di.bpmn');
|
2014-08-05 06:17:22 +00:00
|
|
|
bootstrapViewer(xml)(done);
|
2014-04-25 14:14:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|