test(group-behavior): add test for existing categoryValueRef

This commit is contained in:
Niklas Kiefer 2019-05-15 12:03:56 +02:00
parent a7e3980059
commit 92640b9c06
1 changed files with 26 additions and 0 deletions

View File

@ -32,6 +32,32 @@ describe('features/modeling/behavior - groups', function() {
describe('creation', function() { describe('creation', function() {
it('should NOT create new CategoryValue if one exists', inject(
function(canvas, elementFactory, elementRegistry, modeling) {
// given
var group1 = elementRegistry.get('Group_1'),
categoryValue = getBusinessObject(group1).categoryValueRef,
root = canvas.getRootElement(),
definitions = getBusinessObject(root).$parent,
originalSize = definitions.get('rootElements').length;
var group = elementFactory.createShape({ type: 'bpmn:Group' });
getBusinessObject(group).categoryValueRef = categoryValue;
// when
var groupShape = modeling.createShape(group, { x: 100, y: 100 }, root),
categoryValueRef = getBusinessObject(groupShape).categoryValueRef;
// then
expect(categoryValueRef).to.eql(categoryValue);
expect(originalSize).to.equal(definitions.get('rootElements').length);
}
));
describe('should create new Category for every new Group', function() { describe('should create new Category for every new Group', function() {
it('execute', inject(function(canvas, elementFactory, modeling) { it('execute', inject(function(canvas, elementFactory, modeling) {