fix(moddle-copy): primitive arrays cloning
Closes https://github.com/bpmn-io/bpmn-js/issues/1518
This commit is contained in:
parent
5eaf74e91b
commit
4ccf488a9f
|
@ -234,8 +234,6 @@ ModdleCopy.prototype.copyProperty = function(property, parent, propertyName) {
|
|||
|
||||
// copying might NOT be allowed
|
||||
if (copiedProperty) {
|
||||
copiedProperty.$parent = parent;
|
||||
|
||||
return childProperties.concat(copiedProperty);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
"name": "value",
|
||||
"isAttr": true,
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "paths",
|
||||
"type": "String",
|
||||
"isMany": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -781,6 +781,40 @@ describe('features/copy-paste/ModdleCopy', function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
describe('custom', function() {
|
||||
|
||||
var customPackage = require('../../../fixtures/json/model/custom.json');
|
||||
|
||||
beforeEach(bootstrapModeler(basicXML, {
|
||||
modules: testModules,
|
||||
moddleExtensions: {
|
||||
custom: customPackage
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
it('should copy arrays of strings', inject(function(moddle, moddleCopy) {
|
||||
|
||||
// given
|
||||
var paths = [ 'A', 'B', 'C' ];
|
||||
|
||||
var customElement = moddle.create('custom:CustomSendElement', {
|
||||
paths: paths
|
||||
});
|
||||
|
||||
// when
|
||||
var newElement = moddleCopy.copyElement(customElement, moddle.create('custom:CustomSendElement'));
|
||||
|
||||
// then
|
||||
expect(newElement.paths).to.have.length(3);
|
||||
expect(newElement.paths).to.eql(paths);
|
||||
|
||||
expectNoAttrs(newElement);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue