Comfy-Org / Comfy-Org/ComfyUI_frontend

Add unit tests for resolveSubgraphInputLink

Open
#9,293 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:subgraph area:testing
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Description

Add dedicated unit tests for the `resolveSubgraphInputLink` function in `src/core/graph/subgraph/resolveSubgraphInputLink.ts`.

The function has non-trivial logic (reverse iteration, link resolution, lazy widget caching) and is used in critical call sites, but currently lacks focused unit tests. The behavior is only exercised indirectly through integration-level subgraph tests.

## Test Coverage Needed

A new test file `resolveSubgraphInputLink.test.ts` should cover:
- Non-subgraph node returns `undefined`
- Missing input slot handling
- Broken link scenarios
- Lazy `getTargetWidget` caching behavior

## Context

- Related PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9282
- Original discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9282#discussion_r2866949167
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9293-Add-unit-tests-for-resolveSubgraphInputLink-3156d73d365081ef9174c71af7479359) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.