[backport rh-test] Fix type on LoadClip being marked as asset (#6214)

Backport of #6207 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6214-backport-rh-test-Fix-type-on-LoadClip-being-marked-as-asset-2956d73d36508180b4ccd59a40672327)
by [Unito](https://www.unito.io)

Co-authored-by: AustinMroz <austin@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2025-10-23 12:56:53 +09:00
committed by GitHub
parent f0a19ebb1d
commit dd1af641db
6 changed files with 45 additions and 40 deletions

View File

@@ -288,7 +288,7 @@ describe('useModelToNodeStore', () => {
// Non-existent nodes are filtered out from registered types
const types = modelToNodeStore.getRegisteredNodeTypes()
expect(types.has('NonExistentLoader')).toBe(false)
expect(types['NonExistentLoader']).toBe(undefined)
expect(
modelToNodeStore.getCategoryForNodeType('NonExistentLoader')
@@ -347,13 +347,13 @@ describe('useModelToNodeStore', () => {
})
describe('getRegisteredNodeTypes', () => {
it('should return a Set instance', () => {
it('should return an object', () => {
const modelToNodeStore = useModelToNodeStore()
const result = modelToNodeStore.getRegisteredNodeTypes()
expect(result).toBeInstanceOf(Set)
expect(result).toBeTypeOf('object')
})
it('should return empty set when nodeDefStore is empty', () => {
it('should return empty Record when nodeDefStore is empty', () => {
// Create fresh Pinia for this test to avoid state persistence
setActivePinia(createPinia())
@@ -363,7 +363,7 @@ describe('useModelToNodeStore', () => {
const modelToNodeStore = useModelToNodeStore()
const result = modelToNodeStore.getRegisteredNodeTypes()
expect(result.size).toBe(0)
expect(result).toStrictEqual({})
// Restore original mock for subsequent tests
vi.mocked(useNodeDefStore, { partial: true }).mockReturnValue({
@@ -371,16 +371,15 @@ describe('useModelToNodeStore', () => {
})
})
it('should contain node types for efficient Set.has() lookups', () => {
it('should contain node types to resolve widget name', () => {
const modelToNodeStore = useModelToNodeStore()
modelToNodeStore.registerDefaults()
const result = modelToNodeStore.getRegisteredNodeTypes()
// Test Set.has() functionality which assetService depends on
expect(result.has('CheckpointLoaderSimple')).toBe(true)
expect(result.has('LoraLoader')).toBe(true)
expect(result.has('NonExistentNode')).toBe(false)
expect(result['CheckpointLoaderSimple']).toBe('ckpt_name')
expect(result['LoraLoader']).toBe('lora_name')
expect(result['NonExistentNode']).toBe(undefined)
})
})