I am currently writing some unittest via using gojs models.
I have following code in typescript.
let model = new go.GraphLinksModel();
let node = new go.Node();
let nodeData = model.copyNodeData(node); // warning here
model.startTransaction(“Add node”);
model.addNodeData(nodeData);
model.commitTransaction(“Add node”);
There is no problem if I get the model from a real diagram by using the way any sample provided. However, I get following log warning now.
LOG: ‘Warning: found GraphObject or Diagram reference when copying model data on property “port” of data object: Node#1114
Model data should not have any references to a Diagram or any part of a diagram, such as: Node#1114’
LOG: ‘Warning: found GraphObject or Diagram reference when copying model data on property “bc” of data object: Node#1114
Model data should not have any references to a Diagram or any part of a diagram, such as: Node#1114’
LOG: ‘Warning: found GraphObject or Diagram reference when copying model data on property “locationObject” of data object: Node#1114
Model data should not have any references to a Diagram or any part of a diagram, such as: Node#1114’
LOG: ‘Warning: found GraphObject or Diagram reference when copying model data on property “self” of data object: Node#1114
Model data should not have any references to a Diagram or any part of a diagram, such as: Node#1114’
Any idea? This won’t break the test but just a little bit annoying.
Thanks,
Chuan