test(moddle-copy): verify that string arrays work

Related to https://github.com/bpmn-io/bpmn-js/issues/1518
This commit is contained in:
Niklas Kiefer 2021-11-23 15:57:26 +01:00
parent 0f4d30829d
commit 832f920a59
2 changed files with 39 additions and 0 deletions

View File

@ -22,6 +22,11 @@
"name": "value",
"isAttr": true,
"type": "String"
},
{
"name": "paths",
"type": "String",
"isMany": true
}
]
},

View File

@ -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);
}));
});
});