refactor(nodes): rename computed to measured, add helpers

This commit is contained in:
moklick
2024-04-03 14:54:24 +02:00
parent f45f50671d
commit ea18e46a1a
32 changed files with 159 additions and 226 deletions
@@ -136,8 +136,8 @@ describe('applyChanges Testing', () => {
];
const nextNodes = applyNodeChanges(nodeChanges, nodes);
expect(nodes[0].computed).to.be.undefined;
expect(nextNodes[0].computed).to.be.deep.equal({ width: newWidth, height: newHeight });
expect(nodes[0].measured).to.be.undefined;
expect(nextNodes[0].measured).to.be.deep.equal({ width: newWidth, height: newHeight });
expect(nextNodes[0].width).to.be.undefined;
expect(nextNodes[0].height).to.be.undefined;
});
@@ -153,7 +153,7 @@ describe('applyChanges Testing', () => {
const nextNodes = applyNodeChanges(nodeChanges, nodes);
expect(nextNodes[0].position).to.be.deep.equal(newPosition);
expect(nextNodes[0].computed).to.be.deep.equal({ width: newWidth, height: newHeight });
expect(nextNodes[0].measured).to.be.deep.equal({ width: newWidth, height: newHeight });
});
it('replaces nodes/edges', () => {