mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-09 15:10:17 +00:00
Add group nodes to search and node library (#861)
* Register group nodes in nodeDefStore * Add playwright tests * Update test expectations [skip ci] * Mock nodeDefStore in group node unit test --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { APIConfig, mockApi, mockSettingStore } from './setup'
|
||||
import { APIConfig, mockApi, mockSettingStore, mockNodeDefStore } from './setup'
|
||||
import { Ez, EzGraph, EzNameSpace } from './ezgraph'
|
||||
import lg from './litegraph'
|
||||
import fs from 'fs'
|
||||
@@ -44,6 +44,7 @@ export async function start(config: StartConfig = {}): Promise<StartResult> {
|
||||
const { app } = await import('../../src/scripts/app')
|
||||
const { useSettingStore } = await import('../../src/stores/settingStore')
|
||||
useSettingStore().addSettings(app.ui.settings)
|
||||
mockNodeDefStore()
|
||||
|
||||
const { LiteGraph, LGraphCanvas } = await import('@comfyorg/litegraph')
|
||||
config.preSetup?.(app)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { ComfySettingsDialog } from '@/scripts/ui/settings'
|
||||
import type { ComfyApp } from '@/scripts/app'
|
||||
import '../../src/scripts/api'
|
||||
import { ComfyNodeDef } from '@/types/apiTypes'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
@@ -124,3 +125,13 @@ export const mockSettingStore = () => {
|
||||
useSettingStore: jest.fn(() => mockedSettingStore)
|
||||
}))
|
||||
}
|
||||
|
||||
export const mockNodeDefStore = () => {
|
||||
const mockedNodeDefStore = {
|
||||
addNodeDef: jest.fn((nodeDef: ComfyNodeDef) => {})
|
||||
}
|
||||
|
||||
jest.mock('@/stores/nodeDefStore', () => ({
|
||||
useNodeDefStore: jest.fn(() => mockedNodeDefStore)
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user