Fix test cases

Turns out the vuedraggable import has side effects that break other
test cases. This is awful and requires further investigation, but for
now, the import is performed at execution time
This commit is contained in:
Austin Mroz
2025-09-27 15:34:39 -05:00
parent 44d57ce041
commit e91bbf030b
4 changed files with 23 additions and 13 deletions

View File

@@ -46,7 +46,7 @@ function onClick() {
padding: 4px 16px 4px 0;
word-break: break-all;
border-radius: 4px;
background: var(--bg-color, #202020);
background: var(--p-dialog-background, #202020);
}
.widget-node {
color: var(--color-slate-100, #9c9eab);

View File

@@ -1,4 +1,3 @@
import SubgraphNode from '@/components/selectionbar/SubgraphNode.vue'
import { type DialogComponentProps, useDialogStore } from '@/stores/dialogStore'
const key = 'global-subgraph-node-config'
@@ -11,11 +10,15 @@ export function showSubgraphNodeDialog() {
closable: false,
position: 'right'
}
dialogStore.showDialog({
title: 'Parameters',
key,
component: SubgraphNode,
dialogComponentProps
})
//FIXME: the vuedraggable import has unknown sideffects that break tests.
void import('@/components/selectionbar/SubgraphNode.vue').then(
(SubgraphNode) => {
dialogStore.showDialog({
title: 'Parameters',
key,
component: SubgraphNode,
dialogComponentProps
})
}
)
}

View File

@@ -134,6 +134,7 @@ LiteGraphGlobal {
"WIDGET_BGCOLOR": "#222",
"WIDGET_DISABLED_TEXT_COLOR": "#666",
"WIDGET_OUTLINE_COLOR": "#666",
"WIDGET_PROMOTED_OUTLINE_COLOR": "#BF00FF",
"WIDGET_SECONDARY_TEXT_COLOR": "#999",
"WIDGET_TEXT_COLOR": "#DDD",
"allow_multi_output_for_events": true,

View File

@@ -1,15 +1,21 @@
import { describe, expect, test, vi } from 'vitest'
import '@/core/graph/subgraph/proxyWidget'
//import { ComponentWidgetImpl, DOMWidgetImpl } from '@/scripts/domWidget'
import { LGraphNode, type SubgraphNode } from '@/lib/litegraph/src/litegraph'
import { registerProxyWidgets } from '@/core/graph/subgraph/proxyWidget'
import {
type LGraphCanvas,
LGraphNode,
type SubgraphNode
} from '@/lib/litegraph/src/litegraph'
import {
createTestSubgraph,
createTestSubgraphNode
} from '../litegraph/subgraph/fixtures/subgraphHelpers'
registerProxyWidgets({
canvas: { addEventListener() {} }
} as unknown as LGraphCanvas)
vi.mock('@/renderer/core/canvas/canvasStore', () => ({
useCanvasStore: () => ({})
}))