mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-11 01:28:03 +00:00
- Reuse shared litegraph/subgraph test factories instead of hand-rolled mocks - Seed required_input_missing errors via shared executionErrorTestUtils helper - Use createTestingPinia in executionErrorStore derived-state tests - Drop change-detector assertion on the zeroUuid constant - Replace fromAny/as-unknown-as with fromPartial or honest signatures (widen ComfyButtonGroup.insert and loadGraphData to inputs they already handle) - Isolate ChangeTracker.init prototype/listener side effects per test - Reset fetchJobs mock implementations and fake timers between tests
33 lines
839 B
TypeScript
33 lines
839 B
TypeScript
import type { NodeError } from '@/schemas/apiSchema'
|
|
import type { useExecutionErrorStore } from '@/stores/executionErrorStore'
|
|
import type { NodeExecutionId } from '@/types/nodeIdentification'
|
|
|
|
type ExecutionErrorStore = ReturnType<typeof useExecutionErrorStore>
|
|
|
|
export function createRequiredInputMissingNodeError(
|
|
inputName: string
|
|
): NodeError {
|
|
return {
|
|
errors: [
|
|
{
|
|
type: 'required_input_missing',
|
|
message: 'Missing',
|
|
details: '',
|
|
extra_info: { input_name: inputName }
|
|
}
|
|
],
|
|
dependent_outputs: [],
|
|
class_type: 'TestNode'
|
|
}
|
|
}
|
|
|
|
export function seedRequiredInputMissingNodeError(
|
|
store: ExecutionErrorStore,
|
|
executionId: NodeExecutionId,
|
|
inputName: string
|
|
): void {
|
|
store.lastNodeErrors = {
|
|
[executionId]: createRequiredInputMissingNodeError(inputName)
|
|
}
|
|
}
|