Compare commits

...

5 Commits

Author SHA1 Message Date
bymyself
a0a803af78 fix: narrow node.widgets type with non-null assertion
Fixes typecheck failure introduced in b949536e7 where the unconditional
expect(node.widgets).toHaveLength(1) assertion does not narrow the type
for the subsequent node.widgets[0].value access.

Uses the established codebase pattern (see LGraphNode.widgetOrder.test.ts)
of node.widgets! to assert non-null in tests.

Also picks up oxfmt whitespace normalization on two unrelated lines.
2026-05-02 14:02:16 -07:00
bymyself
b949536e73 fix: replace conditional guard with unconditional assertion
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/11149#discussion_r3117139533
2026-04-22 18:46:06 -07:00
bymyself
d231913f3a fix: add assertions to recreateWidget test
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/11149#discussion_r3117134964
2026-04-22 18:43:18 -07:00
bymyself
cbb2bb22a5 refactor: extract makeWidget helper to avoid as any casts
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/11149#discussion_r3117122698
2026-04-22 18:43:08 -07:00
bymyself
ada3e30090 test: add unit tests for widgetInputs (0% → 90% coverage)
- PrimitiveNode class: applyToGraph, refreshComboInNode,
  onConnectionsChange, onConnectOutput, onLastDisconnect,
  onAfterGraphConfigured, recreateWidget
- Exported functions: getWidgetConfig, convertToInput,
  setWidgetConfig, mergeIfValid
- Extension registration: beforeRegisterNodeDef callbacks
  (convertWidgetToInput, onGraphConfigured, onConfigure,
  onInputDblClick), registerCustomNodes
- 47 behavioral tests covering value propagation, text
  replacements, combo refresh, widget cleanup, connection
  validation, and primitive node auto-creation
2026-04-10 17:26:08 -07:00

File diff suppressed because it is too large Load Diff