mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-02 12:13:42 +00:00
chore(tests): instantiate modeler only when neccessary
This commit replaces the test helper #bootstrapBpmnJS with either This ensures we can have different Modeler/Viewer specific bootstrap code being called based on whether we test modeling or viewing only features.
This commit is contained in:
parent
198ac665f9
commit
911e991bc8
@ -1,7 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var BpmnJS = require('../lib/Modeler');
|
|
||||||
|
var Modeler = require('../lib/Modeler'),
|
||||||
|
Viewer = require('../lib/Viewer');
|
||||||
|
|
||||||
// enhance jasmine with test container API
|
// enhance jasmine with test container API
|
||||||
require('jasmine-test-container-support').extend(jasmine);
|
require('jasmine-test-container-support').extend(jasmine);
|
||||||
@ -17,37 +19,12 @@ function options(opts) {
|
|||||||
OPTIONS = opts;
|
OPTIONS = opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap BpmnJS given the specified options and a number of locals (i.e. services)
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* describe(function() {
|
|
||||||
*
|
|
||||||
* var mockEvents;
|
|
||||||
*
|
|
||||||
* beforeEach(bootstrapBpmnJS(function() {
|
|
||||||
* mockEvents = new Events();
|
|
||||||
*
|
|
||||||
* return {
|
|
||||||
* events: mockEvents
|
|
||||||
* };
|
|
||||||
* }));
|
|
||||||
*
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param {Object} (options) optional options to be passed to the diagram upon instantiation
|
|
||||||
* @param {Object|Function} locals the local overrides to be used by the diagram or a function that produces them
|
|
||||||
* @return {Function} a function to be passed to beforeEach
|
|
||||||
*/
|
|
||||||
function bootstrapBpmnJS(diagram, options, locals) {
|
|
||||||
|
|
||||||
return function(done) {
|
function bootstrapBpmnJS(BpmnJS, options, locals) {
|
||||||
|
|
||||||
var testContainer = jasmine.getEnv().getTestContainer();
|
var testContainer = jasmine.getEnv().getTestContainer();
|
||||||
|
|
||||||
var _diagram = diagram,
|
var _options = options,
|
||||||
_options = options,
|
|
||||||
_locals = locals;
|
_locals = locals;
|
||||||
|
|
||||||
if (_locals === undefined && _.isFunction(_options)) {
|
if (_locals === undefined && _.isFunction(_options)) {
|
||||||
@ -77,21 +54,18 @@ function bootstrapBpmnJS(diagram, options, locals) {
|
|||||||
|
|
||||||
_options.modules = _.unique(_options.modules);
|
_options.modules = _.unique(_options.modules);
|
||||||
|
|
||||||
if (_options.modules.length == 0) {
|
if (!_options.modules.length) {
|
||||||
_options.modules = undefined;
|
_options.modules = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
BPMN_JS = new BpmnJS(_options);
|
BPMN_JS = new BpmnJS(_options);
|
||||||
|
|
||||||
// import diagram
|
return BPMN_JS;
|
||||||
BPMN_JS.importXML(_diagram, done);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects services of an instantiated diagram into the argument.
|
* Bootstrap the Modeler given the specified options and a number of locals (i.e. services)
|
||||||
*
|
|
||||||
* Use it in conjunction with {@link #bootstrapBpmnJS}.
|
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@ -99,7 +73,80 @@ function bootstrapBpmnJS(diagram, options, locals) {
|
|||||||
*
|
*
|
||||||
* var mockEvents;
|
* var mockEvents;
|
||||||
*
|
*
|
||||||
* beforeEach(bootstrapBpmnJS(...));
|
* beforeEach(bootstrapModeler('some-xml', function() {
|
||||||
|
* mockEvents = new Events();
|
||||||
|
*
|
||||||
|
* return {
|
||||||
|
* events: mockEvents
|
||||||
|
* };
|
||||||
|
* }));
|
||||||
|
*
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {String} xml document to display
|
||||||
|
* @param {Object} (options) optional options to be passed to the diagram upon instantiation
|
||||||
|
* @param {Object|Function} locals the local overrides to be used by the diagram or a function that produces them
|
||||||
|
* @return {Function} a function to be passed to beforeEach
|
||||||
|
*/
|
||||||
|
function bootstrapModeler(diagram, options, locals) {
|
||||||
|
|
||||||
|
return function(done) {
|
||||||
|
// bootstrap
|
||||||
|
var modeler = bootstrapBpmnJS(Modeler, options, locals);
|
||||||
|
|
||||||
|
// import diagram
|
||||||
|
modeler.importXML(diagram, done);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap the Viewer given the specified options and a number of locals (i.e. services)
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* describe(function() {
|
||||||
|
*
|
||||||
|
* var mockEvents;
|
||||||
|
*
|
||||||
|
* beforeEach(bootstrapViewer('some-xml', function() {
|
||||||
|
* mockEvents = new Events();
|
||||||
|
*
|
||||||
|
* return {
|
||||||
|
* events: mockEvents
|
||||||
|
* };
|
||||||
|
* }));
|
||||||
|
*
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {String} xml document to display
|
||||||
|
* @param {Object} (options) optional options to be passed to the diagram upon instantiation
|
||||||
|
* @param {Object|Function} locals the local overrides to be used by the diagram or a function that produces them
|
||||||
|
* @return {Function} a function to be passed to beforeEach
|
||||||
|
*/
|
||||||
|
function bootstrapViewer(diagram, options, locals) {
|
||||||
|
|
||||||
|
return function(done) {
|
||||||
|
// bootstrap
|
||||||
|
var viewer = bootstrapBpmnJS(Viewer, options, locals);
|
||||||
|
|
||||||
|
// import diagram
|
||||||
|
viewer.importXML(diagram, done);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injects services of an instantiated diagram into the argument.
|
||||||
|
*
|
||||||
|
* Use it in conjunction with {@link #bootstrapModeler} or {@link #bootstrapViewer}.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* describe(function() {
|
||||||
|
*
|
||||||
|
* var mockEvents;
|
||||||
|
*
|
||||||
|
* beforeEach(bootstrapViewer(...));
|
||||||
*
|
*
|
||||||
* it('should provide mocked events', inject(function(events) {
|
* it('should provide mocked events', inject(function(events) {
|
||||||
* expect(events).toBe(mockEvents);
|
* expect(events).toBe(mockEvents);
|
||||||
@ -114,7 +161,7 @@ function inject(fn) {
|
|||||||
return function() {
|
return function() {
|
||||||
|
|
||||||
if (!BPMN_JS) {
|
if (!BPMN_JS) {
|
||||||
throw new Error('no bootstraped bpmn-js instance, ensure you created it via #bootstrapBpmnJS');
|
throw new Error('no bootstraped bpmn-js instance, ensure you created it via #boostrap(Modeler|Viewer)');
|
||||||
}
|
}
|
||||||
|
|
||||||
BPMN_JS.invoke(fn);
|
BPMN_JS.invoke(fn);
|
||||||
@ -122,5 +169,6 @@ function inject(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports.bootstrapBpmnJS = (window || global).bootstrapBpmnJS = bootstrapBpmnJS;
|
module.exports.bootstrapModeler = (window || global).bootstrapModeler = bootstrapModeler;
|
||||||
|
module.exports.bootstrapViewer = (window || global).bootstrapViewer = bootstrapViewer;
|
||||||
module.exports.inject = (window || global).inject = inject;
|
module.exports.inject = (window || global).inject = inject;
|
@ -3,8 +3,6 @@
|
|||||||
var Matchers = require('../Matchers'),
|
var Matchers = require('../Matchers'),
|
||||||
TestHelper = require('../TestHelper');
|
TestHelper = require('../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../Matchers'),
|
var Matchers = require('../Matchers'),
|
||||||
TestHelper = require('../TestHelper');
|
TestHelper = require('../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../Matchers'),
|
var Matchers = require('../../Matchers'),
|
||||||
TestHelper = require('../../TestHelper');
|
TestHelper = require('../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -16,135 +16,135 @@ describe('draw - bpmn renderer', function() {
|
|||||||
|
|
||||||
it('should render activity markers', function(done) {
|
it('should render activity markers', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/activity-markers.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/activity-markers.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render activity markers (combination)', function(done) {
|
it('should render activity markers (combination)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/activity-markers-combination.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/activity-markers-combination.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render conditional flows', function(done) {
|
it('should render conditional flows', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render conditional default flows', function(done) {
|
it('should render conditional default flows', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-default.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-default.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render NO conditional flow (gateway)', function(done) {
|
it('should render NO conditional flow (gateway)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-gateways.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-gateways.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render conditional flow (typed task)', function(done) {
|
it('should render conditional flow (typed task)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-typed-task.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/conditional-flow-typed-task.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render data objects', function(done) {
|
it('should render data objects', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/data-objects.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/data-objects.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render events', function(done) {
|
it('should render events', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/events.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/events.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render events (interrupting)', function(done) {
|
it('should render events (interrupting)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/events-interrupting.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/events-interrupting.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render event subprocesses (collapsed)', function(done) {
|
it('should render event subprocesses (collapsed)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/event-subprocesses-collapsed.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/event-subprocesses-collapsed.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render event subprocesses (expanded)', function(done) {
|
it('should render event subprocesses (expanded)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/event-subprocesses-expanded.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/event-subprocesses-expanded.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render gateways', function(done) {
|
it('should render gateways', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/gateways.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/gateways.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render group', function(done) {
|
it('should render group', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/group.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/group.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render message marker', function(done) {
|
it('should render message marker', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/message-marker.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/message-marker.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render pools', function(done) {
|
it('should render pools', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/pools.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/pools.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render pool collection marker', function(done) {
|
it('should render pool collection marker', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/pools-with-collection-marker.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/pools-with-collection-marker.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render task types', function(done) {
|
it('should render task types', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/task-types.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/task-types.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render text annotations', function(done) {
|
it('should render text annotations', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/text-annotation.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/text-annotation.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should render flow markers', function(done) {
|
it('should render flow markers', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/flow-markers.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/flow-markers.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render xor gateways blank and with X', function(done) {
|
it('should render xor gateways blank and with X', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/xor.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/xor.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render boundary events with correct z-index', function(done) {
|
it('should render boundary events with correct z-index', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-z-index.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-z-index.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render boundary events without flowNodeRef', function(done) {
|
it('should render boundary events without flowNodeRef', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-without-refnode.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-without-refnode.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render boundary event only once if referenced incorrectly via flowNodeRef (robustness)', function(done) {
|
it('should render boundary event only once if referenced incorrectly via flowNodeRef (robustness)', function(done) {
|
||||||
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-with-refnode.bpmn', 'utf8');
|
var xml = fs.readFileSync(__dirname + '/../../fixtures/bpmn/draw/boundary-event-with-refnode.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
var TestHelper = require('../../TestHelper');
|
var TestHelper = require('../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ describe('environment - mocking', function() {
|
|||||||
|
|
||||||
var mockEvents, bootstrapCalled;
|
var mockEvents, bootstrapCalled;
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, {
|
beforeEach(bootstrapViewer(diagramXML, {
|
||||||
modules: Viewer.prototype._modules
|
modules: Viewer.prototype._modules
|
||||||
}, function() {
|
}, function() {
|
||||||
mockEvents = new Events();
|
mockEvents = new Events();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -21,7 +21,7 @@ describe('features - context-pad', function() {
|
|||||||
|
|
||||||
var testModules = [ contextPadModule, bpmnModule ];
|
var testModules = [ contextPadModule, bpmnModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('bootstrap', function() {
|
describe('bootstrap', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -26,7 +26,7 @@ describe('features - label-editing', function() {
|
|||||||
|
|
||||||
var testModules = [ labelEditingModule, bpmnModule ];
|
var testModules = [ labelEditingModule, bpmnModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('basics', function() {
|
describe('basics', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -47,7 +47,7 @@ describe('direct editing - touch integration', function() {
|
|||||||
|
|
||||||
var testModules = [ labelEditingModule, touchModule ];
|
var testModules = [ labelEditingModule, touchModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
it('should work via dbltap (manual test)', function() { });
|
it('should work via dbltap (manual test)', function() { });
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapModeler, inject */
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ describe('features/modeling - append shape', function() {
|
|||||||
|
|
||||||
var testModules = [ drawModule, modelingModule ];
|
var testModules = [ drawModule, modelingModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('shape handling', function() {
|
describe('shape handling', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapModeler, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -20,7 +20,7 @@ describe('features - bpmn-factory', function() {
|
|||||||
|
|
||||||
var testModules = [ modelingModule ];
|
var testModules = [ modelingModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('create di', function() {
|
describe('create di', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapModeler, inject */
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ describe('features/modeling - create connection', function() {
|
|||||||
|
|
||||||
var testModules = [ drawModule, modelingModule ];
|
var testModules = [ drawModule, modelingModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('connection handling', function() {
|
describe('connection handling', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapModeler, inject */
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ describe('features/modeling - layout connection', function() {
|
|||||||
|
|
||||||
var testModules = [ drawModule, modelingModule ];
|
var testModules = [ drawModule, modelingModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('connection handling', function() {
|
describe('connection handling', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapModeler, inject */
|
||||||
|
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ describe('features/modeling - move shape', function() {
|
|||||||
|
|
||||||
var testModules = [ drawModule, modelingModule ];
|
var testModules = [ drawModule, modelingModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('shape handling', function() {
|
describe('shape handling', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -22,7 +22,7 @@ describe('features - touch', function() {
|
|||||||
|
|
||||||
var testModules = [ touchModule, bpmnModule ];
|
var testModules = [ touchModule, bpmnModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('bootstrap', function() {
|
describe('bootstrap', function() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -24,7 +24,7 @@ describe('features - zoomscroll', function() {
|
|||||||
|
|
||||||
var testModules = [ zoomscrollModule, bpmnModule ];
|
var testModules = [ zoomscrollModule, bpmnModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapViewer(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
|
|
||||||
describe('bootstrap', function() {
|
describe('bootstrap', function() {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
var Matchers = require('../../Matchers'),
|
var Matchers = require('../../Matchers'),
|
||||||
TestHelper = require('../../TestHelper');
|
TestHelper = require('../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -18,7 +18,7 @@ describe('import - collapsed container', function() {
|
|||||||
|
|
||||||
var diagramXML = fs.readFileSync('test/fixtures/bpmn/import/collapsed.bpmn', 'utf8');
|
var diagramXML = fs.readFileSync('test/fixtures/bpmn/import/collapsed.bpmn', 'utf8');
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML));
|
beforeEach(bootstrapViewer(diagramXML));
|
||||||
|
|
||||||
|
|
||||||
it('should import collapsed subProcess', inject(function(elementRegistry) {
|
it('should import collapsed subProcess', inject(function(elementRegistry) {
|
||||||
@ -83,7 +83,7 @@ describe('import - collapsed container', function() {
|
|||||||
|
|
||||||
var diagramXML = fs.readFileSync('test/fixtures/bpmn/import/collapsed-collaboration.bpmn', 'utf8');
|
var diagramXML = fs.readFileSync('test/fixtures/bpmn/import/collapsed-collaboration.bpmn', 'utf8');
|
||||||
|
|
||||||
beforeEach(bootstrapBpmnJS(diagramXML));
|
beforeEach(bootstrapViewer(diagramXML));
|
||||||
|
|
||||||
|
|
||||||
it('should import collapsed subProcess in pool', inject(function(elementRegistry) {
|
it('should import collapsed subProcess in pool', inject(function(elementRegistry) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
var Matchers = require('../../../Matchers'),
|
var Matchers = require('../../../Matchers'),
|
||||||
TestHelper = require('../../../TestHelper');
|
TestHelper = require('../../../TestHelper');
|
||||||
|
|
||||||
/* global bootstrapBpmnJS, inject */
|
/* global bootstrapViewer, inject */
|
||||||
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -18,19 +18,19 @@ describe('import - labels', function() {
|
|||||||
|
|
||||||
it('on flow nodes', function(done) {
|
it('on flow nodes', function(done) {
|
||||||
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/embedded.bpmn', 'utf8');
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/embedded.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('on pools and lanes', function(done) {
|
it('on pools and lanes', function(done) {
|
||||||
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/collaboration.bpmn', 'utf8');
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/collaboration.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('on message flows', function(done) {
|
it('on message flows', function(done) {
|
||||||
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/collaboration-message-flows.bpmn', 'utf8');
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/collaboration-message-flows.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -40,13 +40,13 @@ describe('import - labels', function() {
|
|||||||
|
|
||||||
it('with di', function(done) {
|
it('with di', function(done) {
|
||||||
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external.bpmn', 'utf8');
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('without di', function(done) {
|
it('without di', function(done) {
|
||||||
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external-no-di.bpmn', 'utf8');
|
var xml = fs.readFileSync('test/fixtures/bpmn/import/labels/external-no-di.bpmn', 'utf8');
|
||||||
bootstrapBpmnJS(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user