Update litegraph (Getters) (#829)

* Update litegraph (Getters)

* Update
This commit is contained in:
Chenlei Hu
2024-09-14 17:10:57 +09:00
committed by GitHub
parent 588cfeca4b
commit 12c699cc87
16 changed files with 36 additions and 50 deletions

View File

@@ -518,8 +518,8 @@ describe('group node', () => {
vaeReroute
])
group1.menu.Clone.call()
expect(app.graph._nodes).toHaveLength(4)
const group2 = graph.find(app.graph._nodes[3])
expect(app.graph.nodes).toHaveLength(4)
const group2 = graph.find(app.graph.nodes[3])
expect(group2.node.type).toEqual('workflow/test')
expect(group2.id).not.toEqual(group1.id)
@@ -679,8 +679,8 @@ describe('group node', () => {
// Clone the node
group1.menu.Clone.call()
expect(app.graph._nodes).toHaveLength(3)
const group2 = graph.find(app.graph._nodes[2])
expect(app.graph.nodes).toHaveLength(3)
const group2 = graph.find(app.graph.nodes[2])
expect(group2.node.type).toEqual('workflow/test')
expect(group2.id).not.toEqual(group1.id)

View File

@@ -32,7 +32,7 @@ describe('LGraph', () => {
const result1 = graph.serialize({ sortNodes: true })
expect(result1.nodes).not.toHaveLength(0)
// @ts-expect-error Access private property.
graph._nodes = swapNodes(graph._nodes)
graph._nodes = swapNodes(graph.nodes)
const result2 = graph.serialize({ sortNodes: true })
expect(result1).toEqual(result2)