Files
ComfyUI_frontend/browser_tests/tests/nodeSearchBoxV2Essentials.spec.ts
Glary-Bot 918cd8b57b FE-568: stop letting essentials_category overwrite nodeSource.type
getNodeSource set type=Essentials whenever essentials_category was
populated, which erased the python_module classification — so a node
shipped from custom_nodes.comfyui-kjnodes with essentials_category set
looked like a core essentials node, and the v2 search Essentials chip
plus organizeAllNodes pulled it (and its pack-prefixed category folder)
into the Essentials view alongside core nodes.

Drop the essentials_category branch from getNodeSource so
nodeSource.type tracks only the python_module. The dedicated Essentials
tab and the v2 search Essentials chip now share resolveEssentialsCategory
(already gated on isCoreNode) as the source of truth.

- isCustomNode is correct again for custom-pack-essentials nodes
- organizeAllNodes no longer needs the Essentials union; Core suffices
- groupNodesByPack no longer needs the essentials_category arg
- nodeDefStore no longer threads essentials_category through getNodeSource
- removed unused NodeSourceType.Essentials, isEssentialNode

Adds:
- Unit regression tests in NodeSearchContent.test.ts covering both
  Essentials and Extensions chips with mixed core/custom-pack nodes
- E2E spec nodeSearchBoxV2Essentials.spec.ts that mocks object_info
  with custom-pack-essentials and core-essentials fixtures and asserts
  the chips classify them correctly

Fixes FE-568
2026-05-13 20:55:06 +00:00

84 lines
2.6 KiB
TypeScript

import { createMockNodeDefinitions } from '@e2e/fixtures/data/nodeDefinitions'
import {
comfyExpect as expect,
comfyPageFixture as test
} from '@e2e/fixtures/ComfyPage'
const CORE_ESSENTIAL = 'FE568CoreEssential'
const CUSTOM_PACK_ESSENTIAL = 'FE568CustomPackEssential'
const fixtureDefs = createMockNodeDefinitions({
[CORE_ESSENTIAL]: {
input: { required: {}, optional: {} },
output: ['IMAGE'],
output_name: ['image'],
output_is_list: [false],
output_node: false,
name: CORE_ESSENTIAL,
display_name: 'FE568 Core Essential',
description: 'Core essential — FE-568 regression fixture',
category: 'image/upscaling',
python_module: 'comfy_extras.nodes_images',
essentials_category: 'image tools'
},
[CUSTOM_PACK_ESSENTIAL]: {
input: { required: {}, optional: {} },
output: ['IMAGE'],
output_name: ['image'],
output_is_list: [false],
output_node: false,
name: CUSTOM_PACK_ESSENTIAL,
display_name: 'FE568 Custom Pack Essential',
description: 'Custom-pack essential — FE-568 regression fixture',
category: 'KJNodes/masking',
python_module: 'custom_nodes.comfyui-kjnodes',
essentials_category: 'image tools'
}
})
test.describe(
'Node search box V2 — Essentials/Extensions classification (FE-568)',
{ tag: '@node' },
() => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.page.route('**/api/object_info', (route) =>
route.fulfill({ json: fixtureDefs })
)
await comfyPage.workflow.reloadAndWaitForApp()
await comfyPage.searchBoxV2.setup()
})
test('Essentials chip excludes custom-pack nodes that declare essentials_category', async ({
comfyPage
}) => {
const { searchBoxV2 } = comfyPage
await searchBoxV2.open()
await searchBoxV2.rootCategoryButton('essentials').click()
await searchBoxV2.input.fill('FE568')
await expect(
searchBoxV2.results.filter({ hasText: 'FE568 Core Essential' })
).toHaveCount(1)
await expect(
searchBoxV2.results.filter({ hasText: 'FE568 Custom Pack Essential' })
).toHaveCount(0)
})
test('Extensions chip includes custom-pack nodes that declare essentials_category', async ({
comfyPage
}) => {
const { searchBoxV2 } = comfyPage
await searchBoxV2.open()
await searchBoxV2.rootCategoryButton('custom').click()
await searchBoxV2.input.fill('FE568')
await expect(
searchBoxV2.results.filter({ hasText: 'FE568 Custom Pack Essential' })
).toHaveCount(1)
await expect(
searchBoxV2.results.filter({ hasText: 'FE568 Core Essential' })
).toHaveCount(0)
})
}
)