You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a model has duplicate dependencies i.e. two properties that both reference another model. Two dependencies will be rendered which is unintended.
Think something like this should work:
//Filter out any duplicate dependenciesdependencyModels=dependencyModels.filter((referenceModel)=>{returndependencyModels.indexOf(referenceModel)===dependencyModels.lastIndexOf(referenceModel);});test('should not return duplicate dependencies',()=>{conststringModel=newStringModel('',undefined);constreferenceModel=newReferenceModel('',undefined,stringModel);constreferenceObjectPropertyModel=newObjectPropertyModel('reference',false,referenceModel);conststringObjectPropertyModel=newObjectPropertyModel('string',false,stringModel);constrawModel=newObjectModel('test',undefined,{reference: referenceObjectPropertyModel,reference2: referenceObjectPropertyModel,string: stringObjectPropertyModel});constmodel=constrainMetaModel(mockedTypeMapping,mockedConstraints,{metaModel: rawModel,constrainedName: '',options: undefined})asConstrainedObjectModel;constdependencies=model.getNearestDependencies();expect(dependencies).toHaveLength(1);expect(dependencies[0]).toEqual(model.properties['reference'].property);});
The text was updated successfully, but these errors were encountered:
Describe the bug
Related to
next
branch.If a model has duplicate dependencies i.e. two properties that both reference another model. Two dependencies will be rendered which is unintended.
Think something like this should work:
The text was updated successfully, but these errors were encountered: