bpmn-js/test/spec/features/modeling/behavior/CreateBehaviorSpec.js
Philipp Fromme 194b963959 chore(copy-paste): rework and base upon diagram-js@5
* use <copyPaste.canCopyProperty> event to copy category value when copying group
* add camunda-bpmn-moddle for integration tests

BREAKING CHANGES

* CopyPaste: remove <property.clone>, add <moddleCopy.canCopyProperties>, <moddleCopy.canCopyProperty>, <moddleCopy.canSetCopiedProperty>
* BpmnRules: removed <elements.paste> rule in favor of <elements.create> rule
* BpmnRules: removed <element.paste> rule
* ElementFactory: use <attrs.di> property instead of <attrs.colors> for fill and stroke when creating element through ElementFactory#createBpmnElement
2019-08-07 16:03:55 +00:00

42 lines
964 B
JavaScript

import {
bootstrapModeler,
inject
} from 'test/TestHelper';
import coreModule from 'lib/core';
import modelingModule from 'lib/features/modeling';
import { getMid } from 'diagram-js/lib/layout/LayoutUtil';
describe('features/modeling - CreateBehavior', function() {
var processDiagramXML = require('./CreateBehavior.bpmn');
beforeEach(bootstrapModeler(processDiagramXML, {
modules: [
coreModule,
modelingModule
]
}));
it('should ensure parent is participant', inject(
function(elementFactory, elementRegistry, modeling) {
// given
var lane = elementRegistry.get('Lane_1'),
participant = elementRegistry.get('Participant_1');
var task = elementFactory.createShape({
type: 'bpmn:Task'
});
// when
modeling.createShape(task, getMid(lane), lane);
// then
expect(task.parent).to.equal(participant);
}
));
});