mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
Add Subgraphs (#1000)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { beforeEach, describe, expect } from "vitest"
|
||||
|
||||
import { LGraphNode } from "@/LGraphNode"
|
||||
import { LiteGraph } from "@/litegraph"
|
||||
import { LGraphNode, LiteGraph } from "@/litegraph"
|
||||
|
||||
import { test } from "./testExtensions"
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ describe("LGraphNode", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
origLiteGraph = Object.assign({}, LiteGraph)
|
||||
// @ts-expect-error
|
||||
delete origLiteGraph.Classes
|
||||
|
||||
Object.assign(LiteGraph, {
|
||||
NODE_TITLE_HEIGHT: 20,
|
||||
|
||||
@@ -240,11 +240,13 @@ LGraph {
|
||||
"widgets_up": undefined,
|
||||
},
|
||||
],
|
||||
"_subgraphs": Map {},
|
||||
"_version": 3,
|
||||
"catch_errors": true,
|
||||
"config": {},
|
||||
"elapsed_time": 0.01,
|
||||
"errors_in_execution": undefined,
|
||||
"events": CustomEventTarget {},
|
||||
"execution_time": undefined,
|
||||
"execution_timer_id": undefined,
|
||||
"extra": {},
|
||||
@@ -285,11 +287,13 @@ LGraph {
|
||||
"_nodes_by_id": {},
|
||||
"_nodes_executable": [],
|
||||
"_nodes_in_order": [],
|
||||
"_subgraphs": Map {},
|
||||
"_version": 0,
|
||||
"catch_errors": true,
|
||||
"config": {},
|
||||
"elapsed_time": 0.01,
|
||||
"errors_in_execution": undefined,
|
||||
"events": CustomEventTarget {},
|
||||
"execution_time": undefined,
|
||||
"execution_timer_id": undefined,
|
||||
"extra": {},
|
||||
|
||||
@@ -246,11 +246,13 @@ LGraph {
|
||||
"widgets_up": undefined,
|
||||
},
|
||||
],
|
||||
"_subgraphs": Map {},
|
||||
"_version": 3,
|
||||
"catch_errors": true,
|
||||
"config": {},
|
||||
"elapsed_time": 0.01,
|
||||
"errors_in_execution": undefined,
|
||||
"events": CustomEventTarget {},
|
||||
"execution_time": undefined,
|
||||
"execution_timer_id": undefined,
|
||||
"extra": {},
|
||||
|
||||
@@ -240,11 +240,13 @@ LGraph {
|
||||
"widgets_up": undefined,
|
||||
},
|
||||
],
|
||||
"_subgraphs": Map {},
|
||||
"_version": 3,
|
||||
"catch_errors": true,
|
||||
"config": {},
|
||||
"elapsed_time": 0.01,
|
||||
"errors_in_execution": undefined,
|
||||
"events": CustomEventTarget {},
|
||||
"execution_time": undefined,
|
||||
"execution_timer_id": undefined,
|
||||
"extra": {},
|
||||
@@ -285,11 +287,13 @@ LGraph {
|
||||
"_nodes_by_id": {},
|
||||
"_nodes_executable": [],
|
||||
"_nodes_in_order": [],
|
||||
"_subgraphs": Map {},
|
||||
"_version": 0,
|
||||
"catch_errors": true,
|
||||
"config": {},
|
||||
"elapsed_time": 0.01,
|
||||
"errors_in_execution": undefined,
|
||||
"events": CustomEventTarget {},
|
||||
"execution_time": undefined,
|
||||
"execution_timer_id": undefined,
|
||||
"extra": {},
|
||||
|
||||
@@ -12,6 +12,12 @@ LiteGraphGlobal {
|
||||
"CENTER": 5,
|
||||
"CIRCLE_SHAPE": 3,
|
||||
"CONNECTING_LINK_COLOR": "#AFA",
|
||||
"Classes": {
|
||||
"InputIndicators": [Function],
|
||||
"Rectangle": [Function],
|
||||
"SubgraphIONodeBase": [Function],
|
||||
"SubgraphSlot": [Function],
|
||||
},
|
||||
"ContextMenu": [Function],
|
||||
"CurveEditor": [Function],
|
||||
"DEFAULT_FONT": "Arial",
|
||||
@@ -31,7 +37,6 @@ LiteGraphGlobal {
|
||||
"Globals": {},
|
||||
"HIDDEN_LINK": -1,
|
||||
"INPUT": 1,
|
||||
"InputIndicators": [Function],
|
||||
"LEFT": 3,
|
||||
"LGraph": [Function],
|
||||
"LGraphCanvas": [Function],
|
||||
|
||||
@@ -313,7 +313,7 @@ describe("Rectangle", () => {
|
||||
|
||||
test.each([
|
||||
[[0, 0] as Point, true],
|
||||
[[10, 10] as Point, true],
|
||||
[[9, 9] as Point, true],
|
||||
[[5, 5] as Point, true],
|
||||
[[-1, 5] as Point, false],
|
||||
[[11, 5] as Point, false],
|
||||
@@ -340,7 +340,7 @@ describe("Rectangle", () => {
|
||||
// Outer rectangle is smaller
|
||||
[new Rectangle(0, 0, 5, 5), new Rectangle(0, 0, 10, 10), true],
|
||||
// Same size
|
||||
[new Rectangle(0, 0, 100, 100), true],
|
||||
[new Rectangle(0, 0, 99, 99), true],
|
||||
])("should return %s when checking if %s is inside outer rect", (inner: Rectangle, expectedOrOuter: boolean | Rectangle, expectedIfThreeArgs?: boolean) => {
|
||||
let testOuter = rect
|
||||
rect.updateTo([0, 0, 100, 100])
|
||||
|
||||
Reference in New Issue
Block a user