fix(palette): add required modules

This adds space-tool and lasso-tool as required modules to the BPMN
palette. That in term ensures that users can simply reuse the palette
without further configuration.
This commit is contained in:
Nico Rehwaldt 2015-06-17 12:03:37 +02:00
parent 402e898e91
commit ae962de925
2 changed files with 20 additions and 26 deletions

View File

@ -1,7 +1,9 @@
module.exports = {
__depends__: [
require('diagram-js/lib/features/palette'),
require('diagram-js/lib/features/create')
require('diagram-js/lib/features/create'),
require('diagram-js/lib/features/space-tool'),
require('diagram-js/lib/features/lasso-tool')
],
__init__: [ 'paletteProvider' ],
paletteProvider: [ 'type', require('./PaletteProvider') ]

View File

@ -1,41 +1,33 @@
'use strict';
require('../../../TestHelper');
var TestHelper = require('../../../TestHelper');
/* global bootstrapModeler, inject */
var Modeler = require('../../../../lib/Modeler');
var modelingModule = require('../../../../lib/features/modeling'),
paletteModule = require('../../../../lib/features/palette'),
coreModule = require('../../../../lib/core');
var domQuery = require('min-dom/lib/query');
describe('palette', function() {
describe('features/palette', function() {
var container;
var diagramXML = require('../../../fixtures/bpmn/features/replace/01_replace.bpmn');
beforeEach(function() {
container = jasmine.getEnv().getTestContainer();
});
var testModules = [ coreModule, modelingModule, paletteModule ];
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
it('should should draw palette', function(done) {
var modeler = new Modeler({ container: container });
modeler.createDiagram(function(err) {
// assume
var provider = modeler.get('paletteProvider');
// then
expect(provider).toBeTruthy();
it('should provide BPMN modeling palette', inject(function(canvas, palette) {
// when
var paletteElement = domQuery('.djs-palette', container);
var paletteElement = domQuery('.djs-palette', canvas._container);
var entries = domQuery.all('.entry', paletteElement);
// then
expect(domQuery.all('.entry', paletteElement).length).toBe(10);
done(err);
});
});
expect(entries.length).toBe(10);
}));
});