diff --git a/src/components/dialog/content/ManagerProgressDialogContent.test.ts b/src/components/dialog/content/ManagerProgressDialogContent.test.ts index 801c769da..dc7ac8910 100644 --- a/src/components/dialog/content/ManagerProgressDialogContent.test.ts +++ b/src/components/dialog/content/ManagerProgressDialogContent.test.ts @@ -30,11 +30,20 @@ const defaultMockTaskLogs = [ vi.mock('@/stores/comfyManagerStore', () => ({ useComfyManagerStore: vi.fn(() => ({ - taskLogs: [...defaultMockTaskLogs] + taskLogs: [...defaultMockTaskLogs], + succeededTasksLogs: [...defaultMockTaskLogs], + failedTasksLogs: [...defaultMockTaskLogs], + managerQueue: { historyCount: 2 }, + isLoading: false })), useManagerProgressDialogStore: vi.fn(() => ({ isExpanded: true, - collapse: mockCollapse + activeTabIndex: 0, + getActiveTabIndex: vi.fn(() => 0), + setActiveTabIndex: vi.fn(), + toggle: vi.fn(), + collapse: mockCollapse, + expand: vi.fn() })) })) diff --git a/src/types/comfyManagerTypes.ts b/src/types/comfyManagerTypes.ts index d53251aae..9ccd8a355 100644 --- a/src/types/comfyManagerTypes.ts +++ b/src/types/comfyManagerTypes.ts @@ -1,5 +1,8 @@ import type { InjectionKey, Ref } from 'vue' +import type { AlgoliaNodePack } from '@/types/algoliaTypes' +import type { components } from '@/types/comfyRegistryTypes' + export const IsInstallingKey: InjectionKey> = Symbol('isInstalling') @@ -40,3 +43,19 @@ export interface UseNodePacksOptions { immediate?: boolean maxConcurrent?: number } + +// Node pack types from different sources +export type RegistryPack = components['schemas']['Node'] + +// MergedNodePack is the intersection of AlgoliaNodePack and RegistryPack +// created by lodash merge operation: merge({}, algoliaNodePack, registryPack) +export type MergedNodePack = AlgoliaNodePack & RegistryPack + +/** + * Type guard to check if a node pack is from Algolia (has comfy_nodes) + */ +export function isMergedNodePack( + pack: MergedNodePack | RegistryPack +): pack is MergedNodePack { + return 'comfy_nodes' in pack && Array.isArray(pack.comfy_nodes) +}