mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 20:51:58 +00:00
[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:
@@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user